Skip to content

jankechm/IPP-CSV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSV to XML converter

Converts CSV file to XML file.

Description

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 '&amp', '&lt', '&gt', ...

Syntax

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]

Optional arguments

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)

About

CSV to XML converter (school project)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages