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.

convert xml with multiple row tags to files using nifi

convert xml with multiple row tags to files using nifi

New Contributor

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

Re: convert xml with multiple row tags to files using nifi

Community Manager

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 Manager
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.

Re: convert xml with multiple row tags to files using nifi

New Contributor

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.

Re: convert xml with multiple row tags to files using nifi

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.

Re: convert xml with multiple row tags to files using nifi

New Contributor

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.

Re: convert xml with multiple row tags to files using nifi

New Contributor
Don't have an account?
Coming from Hortonworks? Activate your account here