Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

InvokeHTTP to return CSV

SOLVED Go to solution
Highlighted

InvokeHTTP to return CSV

Contributor

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!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: InvokeHTTP to return CSV

Super Mentor

@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 2

Re: InvokeHTTP to return CSV

Super Mentor

@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


.

Re: InvokeHTTP to return CSV

Contributor

@Jay Kumar SenSharma Thank you very much! It helped