chaelruocco.xml-to-csv.1.0.1.source-code.usage.txt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xml-to-csv Show documentation
Show all versions of xml-to-csv Show documentation
Forked version of fordfrog xml2csv library that allows selection of xml elements via attributes
The newest version!
Usage: java -jar xml2csv-*.jar --columns --input --output --item-name
General command line switches:
--columns
List of columns that should be output to the CSV file. These names must
correspond to the element names within the item element.
--input
Path to the input XML file.
--item-name
XPath which refers to XML element which will be converted to a row. It cannot
end with slash (/).
--join
Join values of multiple elements into single value using (, ) as a separator.
By default value of the first element is saved to CSV.
--output
Path to the output CSV file. Output file content is always in UTF-8 encoding.
--separator
Character that should be used to separate fields. Default value is (;).
--trim
Trim values. By default values are not trimmed.
Filtering rows:
--filter-column
Column on which the filter should be applied. When specifying filter command
line switches, you must use this switch as the first one as it initializes
new filter. You can specify more filters, each one beginning with this
switch. You can filter the rows even on columns that are not part of the
output. Filtering is performed before remapping.
..filter.values
Path to file containing values that the filter should use. Empty rows are
added to the values too.
--filter-exclude
Excludes all rows where the column value matches one of the specified values.
--filter-include
Includes all rows where the column value matches one of the specified values.
This is the default behavior if --filter-exclude|--filter-include is not
specified.
Remapping (replacing) values:
--remap-column
Column in which original values should be replaced with values from map
file. When specifying remapping command line switches, you must use this
switch as the first one as it initializes new remapping. You can specify
more remappings, each one beginning with this switch. Remapping is performed
after filtering.
--remap-map
Path to file containing original value and new value pairs. The file uses
CSV format. Values can be escaped either using single-quote (') or
double-quote ("). Quotes within values can be escaped either doubling them
("" and '') or backslash-escaping them (\" and \').
Characters encoding:
Application expects all files being in UTF-8 encoding.