Support Questions

Find answers, ask questions, and share your expertise

How to Convert XML file into CSV file using NIFI

avatar

i have XML files about 1-2 GB i want it to convert into CSV format using apache nifi.

so that i can process CSV for joining the two csv.

1 ACCEPTED SOLUTION

avatar
Guru

Hi @Nitin Damle

You can use the ConvertRecord processor (with XMLReader/CSVRecordSetWriter controller services). I have an article here that shows CSV to XML (with CSVReader/XMLRecordSetWriter controller services), so you just need to do the inverse of that record transformation:

https://community.hortonworks.com/content/kbentry/199310/xml-record-writer-in-apache-nifi-170.html

-Andrew

View solution in original post

22 REPLIES 22

avatar

@Max Börebäck can you upload the template here

avatar
New Contributor

I have uploaded a NiFi example template on https://github.com/maxbback/nifi-xml

avatar
New Contributor

Depending on the complexity

But one option is to use the built in converters Another Option is to use this groovy script

 

https://github.com/maxbback/nifi-xml