Skip to main content
a_gulshani
Gold ⭐️
June 13, 2019
Solved

InvokeHTTP to return CSV

Hi!

How can I configure InvokeHTTP to return comma separated flow file?

At the moment it is returning file in below format (tab separated):


RELM Satieva_microloans 6 3369 2019-06-12 11:42:00 772103971

RELM Satieva_microloans 6 3369 2019-06-12 11:42:00 772104117

RELM Satieva_microloans 6 3369 2019-06-12 11:42:00 772101000


Thanks in advance!

jsensharma
Platinum ⭐️⭐️
June 14, 2019

@Gulshan Agivetova

May be you can use the "InvokeHTTP" --> "ReplaceText" --> "PutFile" processors like following:

109339-tabs-to-comma-nifi-1.png


Here in "ReplaceText" processor can be used something like following to replace Search Value = TAB with COMMA

ReplaceText Properties:

Search Value =     
Replacement Value = , 
Character Set = UTF-8
Maximum Buffer Size = 1 MB
Replacement Strategy = Regex Replace
Evaluation Mode =  Line-by-Line


109355-tabs-to-comma-nifi-2.png

And then it should be able to replace the TABs with Comma.

The output of the given inout should be something like:

RELM,Satieva_microloans,6,3369,2019-06-12,11:42:00,772103971
RELM,Satieva_microloans,6,3369,2019-06-12,11:42:00,772104117
RELM,Satieva_microloans,6,3369,2019-06-12,11:42:00,772101000


.

2 replies

jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
June 14, 2019

@Gulshan Agivetova

May be you can use the "InvokeHTTP" --> "ReplaceText" --> "PutFile" processors like following:

109339-tabs-to-comma-nifi-1.png


Here in "ReplaceText" processor can be used something like following to replace Search Value = TAB with COMMA

ReplaceText Properties:

Search Value =     
Replacement Value = , 
Character Set = UTF-8
Maximum Buffer Size = 1 MB
Replacement Strategy = Regex Replace
Evaluation Mode =  Line-by-Line


109355-tabs-to-comma-nifi-2.png

And then it should be able to replace the TABs with Comma.

The output of the given inout should be something like:

RELM,Satieva_microloans,6,3369,2019-06-12,11:42:00,772103971
RELM,Satieva_microloans,6,3369,2019-06-12,11:42:00,772104117
RELM,Satieva_microloans,6,3369,2019-06-12,11:42:00,772101000


.

Translate
a_gulshani
Gold ⭐️
June 14, 2019

@Jay Kumar SenSharma Thank you very much! It helped

Translate