Converts CSV file to XML file.
Each CSV line corresponds to defined pair element (see argument -l). The CSV columns will be nested in this element as subelements. The problematic chars like '&', '<', '>', ... are converted to '&', '<', '>', ...
csv.py [--help] [--input filename] [--output filename] [-n]
[-r root-element] [-s separator] [-h [subst]]
[-c column-element] [-l line-element] [-i] [--start [n]] [-e]
[--missing-field val] [--all-columns]
Argument | Description |
---|---|
--help | show the help message |
--input filename | input file (default: stdin) |
--output filename | output file (default: stdout) |
-n | do not generate XML header |
-r root-element | name of the XML root element; if not defined, the output is not wrapped with root element |
-s separator | separator of the CSV cells (1 char) |
-c column-element | name of the element for CSV cells (default: "col"); each element is numbered from 1 |
-l line-element | name of the element for CSV lines (default: "row") |
-i | add attribute "index" to line-element (must be combined with -l) |
--start n | set the counter of the index attribute (must be combined with -i) to n (default: 1) |