Skip to content

Parse an XML file on stdin, write csv to stdout. No schema, no structs required.

License

Notifications You must be signed in to change notification settings

glycerine/xml2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xml2csv

XML is a pain, and the existing Go libraries for dealing with it are a sad lot.

Here we convert .xml to .csv (comma separated values) for sane further processing.

This code will parse an XML file on stdin, and write csv to stdout. No schema required. You do not need to create structs in Go first; no data-specific structs are involved. There is just one tag struct used to process the .xml, and everything ends up in a tree of them.

It was written for a specific need, and is not polished at all. It assumes that the repeated records of interest are at depth one, and turns each of these into a row in the CSV.

Feel free to fork and adapt it to your own needs. I'll probably not do further work on it, but maybe it can be the starting point for something of yours.

Copyright (c) 2023 Jason E. Aten, Ph.D.

License: MIT

About

Parse an XML file on stdin, write csv to stdout. No schema, no structs required.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages