XML in CSV or xlsx or something else

Hey Guys, im totally new and im looking for an Idea or tipp how i can convert a XML file to Excel ?
Someone have an Idea maybe ?

Best regards
Philipp

Hi there,

you have data in XML file which you read into KNIME and want to output it as a Excel file or?

Br,
Ivan

Hi @PhilippBobo,

Use the XML Reader node to read the XML file, then the XPath node to extract what you need (you can remove the source column) and finally the Excel Writer (XLS) node exports the table to an Excel file.

:blush:

1 Like

Hey Armin, yea i will try it. Do you think there is a problem if i have more then one .xml file ? :slight_smile:
Do you have perhabs a example workflow ?

Thanks so far.
Philipp

No, there is no problem. Do you want to append all the XML files in one Excel file or do you want to write each file separately?

I think i would like to separat it. Per xml file one excel file. :slight_smile:

Then use a List Files node and then a Table Row To Variable Loop Start node and put the other nodes inside the loop and end the loop with a Variable Loop End node.

You can manipulate the file path in each loop with the String Manipulation (Variable) node to create the flow variable for the “Output location” option in the configuration window of the Excel Writer (XLS) node.

Here is an example:

xml_to_xlsx.knwf (39.9 KB)

:blush:

P.S. You can also use the Excel Sheet Appender (XLS) node to export each XML file in a new sheet.

2 Likes

Really thank you Armin. I will try it tmr and give you feedback. Thanks

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.