x2c
v0.1.0
Published
CLI for XML to CSV Conversion
Downloads
4
Readme
x2c
CLI for XML to CSV Conversion
usage
create a config.json
x2c uses a configuration file in JSON format. here's an example:
{
"columns": [
{ "name": "name", "path": ["gmd:name", "gco:CharacterString"] },
{ "name": "protocol", "path": ["gmd:protocol", "gco:CharacterString"] },
{ "name": "url", "path": ["gmd:linkage", "gmd:URL"] }
],
"limit": 5,
"offset": 2,
"start": ["gmd:MD_DigitalTransferOptions", "gmd:CI_OnlineResource"],
"debug": false
}
npx
cat data.xml | npx x2c --config=$PWD/config.json > data.csv
global install
npm install -g x2c
cat data.xml | x2c --config=$PWD/config.json > data.csv