cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarinSpence
New Member

Convert XML files to CSV

Could Power Automate be used to convert 34 GB of data spread over 31 XML files to CSV?

1 ACCEPTED SOLUTION

Accepted Solutions
tkuehara
Super User
Super User

Hi @DarinSpence 

 

Short answer: yes, it is technically possible.

Long answer: it would take a long time to read each file and generate a CSV from it. I think there are better ways/tools to do this task.

If you decide to proceed with this solution, here's a sketch (please use the relevant XML-related actions suited to your needs; I used those two just for the example below):

tkuehara_0-1630587282148.png

 

View solution in original post

4 REPLIES 4
tkuehara
Super User
Super User

Hi @DarinSpence 

 

Short answer: yes, it is technically possible.

Long answer: it would take a long time to read each file and generate a CSV from it. I think there are better ways/tools to do this task.

If you decide to proceed with this solution, here's a sketch (please use the relevant XML-related actions suited to your needs; I used those two just for the example below):

tkuehara_0-1630587282148.png

 

You are 100% right about how long it will take to read up the file and convert it to CSV.  I found a simple tool that does this, but not at the command line or in any way that supports processing through a folder of 30 files.  Even though it's just 30 files, I'd like to find a way to automate the conversion of XML to CSV somehow.  

charles_ross_oh
Advocate I
Advocate I

Are they all using the same schema and are they "flat" in structure (table-like) or hierarchical?  Only tabular files would be a good fit. If they are flat XML, Excel will open them and can save to CSV, for example of a dumbed-down approach. Python and the toolkits used by Data analysis and "data science" wrangler crowd (data engineers) surely have some cookbook solutions or even libraries to do this with command lines.  For example docx-utils · PyPI

 

I can also imagine transforming it to JSON in between, because the kids these days tend to have lots of JSON tools for same. There is a command line program named JQ that does all kinds of things like this.     jq (stedolan.github.io)

There is an online solution to automate the conversion of large XML files to CSV (or Excel) format.

https://conversiontools.io/convert/xml-to-csv - Conversion Tools offers a way to transform XML file data into tabular representation.

This works even for non-tabular hierarchical data, the converter making it flat and tabular.

Note: there are limits defined for the file size.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Kudoed Authors
Users online (1,361)