Skip to main content
Solved

Convert a file for me please ?


Forum|alt.badge.img

Hello all,

I am a newbie to FME and have failed at the first hurdle to convert an .XML file to .csv format.

I really want this converted but do not have the time to learn how to use FME (wonderful, though it is) to complete the task.

Would anyone like to do this as a simple challenge to their skills? The file is of no commercial value but it is about 115MB in size. I would simply like it converted to an .xlsx or .csv file with a flat structure.

(I would use somethimg like www.wetransfer.com to send it to you).

Any takers?

Thanks one and all !!

 

Best answer by takashi

Welcome to the FME world!

I think it would be a good opportunity to learn FME basics. Try the following instruction. It's quite easy and I think you can get desired result within 10-20 minutes or so, even if you are new to FME.

Firstly open FME Workbench and open the Add Reader dialog (Workbench Menu: Readers > Add Reader).

  • Format: enter "xml" and select "XML (Extensible Markup Language)".
  • Dataset: select the XML file.
  • Click the Parameters button and configure the parameters like the screenshot below.

See here to learn more: Adding Readers, XML Reader Configuration

 

Close the dialog with OK, then the XML reader and a feature type appear on the Navigator and the Canvas.

 

Open the Add Writer dialog (Workbench Menu: Writers > Add Writer).

  • Format : enter "csv" and select "CSV (Comma Separated Value)".
  • Dataset: select an existing folder into which you want to save the resulting csv file.
  • CSV File Definition: Copy from Reader

See here to learn more: Adding Writers

 

Close the dialog with OK, then the CSV writer and a writer feature type appear on the Navigator and the Canvas. Connect between the XML reader feature type and the CSV writer feature type (drag between them).

 

Open the writer feature type properties dialog. You can modify the destination CSV File Name if necessary.

 

Go to the User Attributes tab. You can see all the column names which will be written into the destination csv file. If there are unnecessary columns, you can remove them (select them and click [-] button).

Close the dialog with OK. You now have a workspace that converts XML to CSV. You can also save the workspace (Menu: File > Save As).

Run the workspace (Menu: Run > Run Workspace or click the green triangle tool button).

Hope this helps.

View original
Did this help you find an answer to your question?

4 replies

xiaomengatsafe
Safer
Forum|alt.badge.img+3

Hi @iluvatar, I highly encourage you to give this conversion a try, following the instructions in these existing resources:

 

https://knowledge.safe.com/articles/30946/how-to-convert-xml-to-microsoft-excel.html

 

https://knowledge.safe.com/questions/55421/reading-xml-file-and-exporting-excel-or-csv.html

With the tree view in the XML reader's Element to match parameter, it's easier than ever to convert XML to CSV or Excel. I'm sure you will be able to achieve your goal.

If you run into any problems in the process, please let us know what you've tried and where you encountered problem. I'm sure the community will be happy to help you get over the hurdle.


Forum|alt.badge.img
  • Author
  • March 19, 2019

Hi xiaomengatsafe,

I attempted to do this but the learning curve is way past my timing, capability and pay grade.

The zipped xml file ( ~9MB) is here for 7 days if anyone would like to have a crack at it !!

https://wetransfer.com/downloads/bad58f9dae9785bfffff982a7bc11e3b20190319110139/527defca5a1bd0666d2cf6d33607446920190319110139/8f70ea

Thanks.


Forum|alt.badge.img
  • Author
  • March 19, 2019
iluvatar wrote:

Hi xiaomengatsafe,

I attempted to do this but the learning curve is way past my timing, capability and pay grade.

The zipped xml file ( ~9MB) is here for 7 days if anyone would like to have a crack at it !!

https://wetransfer.com/downloads/bad58f9dae9785bfffff982a7bc11e3b20190319110139/527defca5a1bd0666d2cf6d33607446920190319110139/8f70ea

Thanks.

Actually the datset is here permanently....

https://data.gov.au/data/dataset/058118a3-b685-4af6-82c2-341a266a661f/resource/8d15c302-b1e2-4908-b860-2a52d6c9980a/download/tpb_register20190317.zip


takashi
Influencer
  • Best Answer
  • March 20, 2019

Welcome to the FME world!

I think it would be a good opportunity to learn FME basics. Try the following instruction. It's quite easy and I think you can get desired result within 10-20 minutes or so, even if you are new to FME.

Firstly open FME Workbench and open the Add Reader dialog (Workbench Menu: Readers > Add Reader).

  • Format: enter "xml" and select "XML (Extensible Markup Language)".
  • Dataset: select the XML file.
  • Click the Parameters button and configure the parameters like the screenshot below.

See here to learn more: Adding Readers, XML Reader Configuration

 

Close the dialog with OK, then the XML reader and a feature type appear on the Navigator and the Canvas.

 

Open the Add Writer dialog (Workbench Menu: Writers > Add Writer).

  • Format : enter "csv" and select "CSV (Comma Separated Value)".
  • Dataset: select an existing folder into which you want to save the resulting csv file.
  • CSV File Definition: Copy from Reader

See here to learn more: Adding Writers

 

Close the dialog with OK, then the CSV writer and a writer feature type appear on the Navigator and the Canvas. Connect between the XML reader feature type and the CSV writer feature type (drag between them).

 

Open the writer feature type properties dialog. You can modify the destination CSV File Name if necessary.

 

Go to the User Attributes tab. You can see all the column names which will be written into the destination csv file. If there are unnecessary columns, you can remove them (select them and click [-] button).

Close the dialog with OK. You now have a workspace that converts XML to CSV. You can also save the workspace (Menu: File > Save As).

Run the workspace (Menu: Run > Run Workspace or click the green triangle tool button).

Hope this helps.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings