Open source command line tool for conversion of CSV data to FundsXML format and vice versa:
- Both conversion directions with same simple mapping definition
- Built in format and content check with detailled error protocol
- Single file conversion and batch mode
- Fully customizable via mapping definition
Command Line Parameters - Single Files
Conversion from CSV to FundsXML:convert -c c2x -i input.csv -m mapping.csv -o output.xml -e errors.csv
Conversion from FundsXML to CSV:convert -c x2c -i input.xml -m mapping.csv -t template.csv -o output.csv -e errors.csv
Parameters:-c direction ........ Conversion direction 'c2x' or 'x2c' (long version: '-conversion' plus 'csv2xml' or 'xml2csv')
-i inputfile ........ Name of input file (long version: '-input')
-m mappingfile ...... Name of mapping file (long version: '-mapping')
-t templatefile ..... Name of template file (long version: '-template')
-o outputfile ....... Name of output file (long version: '-output')
-e errorfile ........ Name of error file (long version: '-error')
Command Line Parameters - Batch Mode
Conversion from CSV to FundsXML:convert -c c2x -i input\*.csv -m holdings-mapping.csv -o output\*.xml -e error -l log.csv -p processed -r counter
Conversion from FundsXML to CSV:convert -c x2c -i input\*.xml -m holdings-mapping.csv -t holdings-template.csv -o output\*.csv -e error -l log.csv -p processed -r counter
Parameters for batch conversion:-e errordir ......... Directory for files with errors in input files (long version: '-error')
-l logfile .......... Name of protocol file with list of processed files and status (long version: '-log')
-p processeddir ..... Directory of processed input files (long version: '-processed')
-r counterdir ....... Directory of counter definitions (long version: '-counter')
Mapping Definition Columns
Column Name | M/O | Content Description |
---|---|---|
CSV_OP | M | Operation: "CHANGE", "FIX", "IF", "MAP", "UNIQUE" or "VAR" |
CSV_CONTENT | M | Column name, constant value (FIX) or pattern (VAR) |
CSV_CONTENT2 | M | Second column name (optional; column names may contain wildcard '*' at the end) |
CSV_MO | O | "M" (Mandatory) or "O" (Optional) |
CSV_TYPE | M | Type: "BOOLEAN", "DATE", "DATETIME", "INTEGER", "NUMBER", "TEXT" |
CSV_FORMAT | O | Regex-Format: e.g. "DD.MM.YYYY", "[A-Z]{3}", "..[B-C].", "(YES,NO)", "(EQ,BO,SC,OP,FU,FX,AC)" |
CSV_MIN_LEN | O | Minimum length of content |
CSV_MAX_LEN | O | Maximum length of content |
CSV_DEFAULT | O | Default value |
CSV_CONDITION | O | Condition: e.g. "CCY != FUND_CCY" |
XML_OP | M | Operation: "FIX", "IF", "LOOP", "MAP", "VAR" |
XML_CONTENT | M | XPath (without root node), constant value (FIX) or pattern (VAR) |
XML_MO | O | "M" (Mandatory) or "O" (Optional) |
XML_TYPE | M | Type: "BOOLEAN", "DATE", "DATETIME", "INTEGER", "NUMBER", "TEXT" |
XML_FORMAT | O | Regex-Format: e.g. "(CALL,PUT)", "(true,false)" |
XML_MIN_LEN | O | Minimum length of content |
XML_MAX_LEN | O | Maximum length of content |
XML_DEFAULT | O | Default value |
XML_CONDITION | O | Condition: e.g. "@ccy = Funds/Fund/Currency" |
Mapping Sample
CSV_OP | CSV_CONTENT | CSV_TYPE | XML_OP | XML_CONTENT | XML_TYPE |
---|---|---|---|---|---|
FIX | SAMPLE.2019-01-10.12345 | TEXT | MAP | ControlData/UniqueDocumentID | TEXT |
VAR | NOW | DATETIME | MAP | ControlData/DocumentGenerated | DATETIME |
MAP | NAV_DATE | DATE | MAP | ControlData/ContentDate | DATE |
FIX | EU | TEXT | MAP | ControlData/DataSupplier/SystemCountry | TEXT |
FIX | SDS | TEXT | MAP | ControlData/DataSupplier/Short | TEXT |
FIX | Sample Data Supplier | TEXT | MAP | ControlData/DataSupplier/Name | TEXT |
FIX | Generic | TEXT | MAP | ControlData/DataSupplier/Type | TEXT |
FIX | EN | TEXT | MAP | ControlData/Language | TEXT |
CHANGE | LEI | TEXT | LOOP | Funds/Fund | |
MAP | LEI | TEXT | MAP | Funds/Fund/Identifiers/LEI | TEXT |
MAP | FUND_NAME | TEXT | MAP | Funds/Fund/Names/OfficialName | TEXT |
MAP | FUND_CCY | TEXT | MAP | Funds/Fund/Currency | TEXT |
FIX | true | BOOLEAN | MAP | Funds/Fund/SingleFundFlag | BOOLEAN |
MAP | FUND_LEGAL_STRUCTURE | TEXT | MAP | Funds/Fund/FundStaticData/ListedLegalStructure | TEXT |
Download FundsXML-CSV-Converter Version 1.03 from July 2019
V1.00: First productive version with mandatory features for conversion of CSV data to FundsXML format and vice versaV1.01: Enhanced mapping of text fields and bugfix for reading numbers with thousand's character
V1.02: Support for two header lines in csv files (if matching column names defined in CSV_CONTENT or CSV_CONTENT2)
V1.03: Support for regular expressions with dots (e.g. "..[A]." or "..[B-C].")
ZIP-file containing source code, Windows executable and sample files (1.8 MB) .....
Link to GitHub repository