Support Questions

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

convert xml with multiple row tags to files using nifi

avatar

Hi ,iam new to nifi , i have xml file with 5 row tags . I want to put each row tag output to one file in hdfs using NIFI . any suggestions please ?

5 REPLIES 5

avatar

Would probably help yourself get an answer if you post the source XML file. If you choose to do this, be sure to remove any sensitive data from it beforehand.

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar

Hi Bill and matt, please find attached sample.xml file . i have 3 row tags food,personal,official . i want to write data to 3 different csv files.

avatar
Master Guru

You should be able to use SplitXml -> PutHDFS, using the Split Depth property to specify where to do the tag splitting. Each tag at that depth will be output as a separate flow file which you can send to HDFS via the PutHDFS processor. You may need to use UpdateAttribute to set the filename attribute, which is used by PutHDFS as the target filename.

avatar

Hi matt, please find attached sample.xml file . i have 3 row tags food,personal,official . i want to write data to 3 different csv files.

avatar