Lee Kelleher

Converting CSV to XML

Posted on . Estimated read time: 2 minutes (257 words)

There’s a bit a functionality on one of the projects that I’m working on where I need to do a lookup. The data I’ve been given is in an Excel spreadsheet – which I needed to convert to XML (as ultimately the data will be stored in a CMS that handles XML better).

I’ve done a lot of projects where I need to convert XML to Excel (via CSV), but not many where I need to convert the other way.

I first saved the Excel as an “XML Spreadsheet” – which spat out all sorts of extra MS Office namespaces, styles, etc. Which is fine if I want to re-open the data in Excel. But I wanted the data to be cleaner (and more semantic).

I exported the Excel out as a CSV; then looked for a way to convert it to XML.

Then I found this very useful web-app tool: CSV to XML Converter by Creativyst

It did exactly what I needed! The tool has a 100Kb limit – which was great, because my CSV was 96Kb!

The outputted XML was around 450Kb – which got me thinking… if a lot of developers use that tool the way I did – then that’s a lot of load on their web-server! Maybe that’s where the new Google App Engine could come in handy?! They have the processing power and bandwidth to handle high usage!

I’d love to see other online text conversion utilities … you never know, maybe they could be all centralised on Google Apps?