Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to splitting a Nifi flowfile into multiple flowfiles

avatar
Explorer

Hi All,

I have the following requirement:

Split a single NiFi flowfile into multiple flowfilesof each of the flowfiles as a separate data

Sample input flowfile:

fieldname value

id 1

name ankit

address ____

id 2

name john

address ______

Desired output files:

Flowfile 1:

fieldname value

id 1

name ankit

address ____

Flowfile 2:

fieldname value

id 2

name john

address ______

.

2 REPLIES 2

avatar
Master Guru

@ANKIT PATEL

Use SplitText processor with below configs:

91425-screen-shot-2018-09-13-at-93006-pm.png

We are keeping header line count as 1 i.e first line treated as header and this header is added to each split and we are splitting 3 lines as one split.

InputFlowFile:

fieldname value
id 1
name ankit
address ____
id 2
name john
address ______

Use Splits relationship from Splittext processor

OutputFlowfiles:

ff1:

fieldname value
id 1
name ankit
address ____

ff2:

fieldname value
id 2
name john
address ______

For more details refer to this link for more details regards to SplitText processor.

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.

avatar
New Contributor

I try this but file split into only one fiile which contain top 3 lines