Command Line FundsXML - CSV Converter

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 NameM/OContent Description
CSV_OPMOperation: "CHANGE", "FIX", "IF", "MAP", "UNIQUE" or "VAR"
CSV_CONTENTMColumn name, constant value (FIX) or pattern (VAR)
CSV_CONTENT2MSecond column name (optional; column names may contain wildcard '*' at the end)
CSV_MOO"M" (Mandatory) or "O" (Optional)
CSV_TYPEMType: "BOOLEAN", "DATE", "DATETIME", "INTEGER", "NUMBER", "TEXT"
CSV_FORMATORegex-Format: e.g. "DD.MM.YYYY", "[A-Z]{3}", "..[B-C].", "(YES,NO)", "(EQ,BO,SC,OP,FU,FX,AC)"
CSV_MIN_LENOMinimum length of content
CSV_MAX_LENOMaximum length of content
CSV_DEFAULTODefault value
CSV_CONDITIONOCondition: e.g. "CCY != FUND_CCY"
XML_OPMOperation: "FIX", "IF", "LOOP", "MAP", "VAR"
XML_CONTENTMXPath (without root node), constant value (FIX) or pattern (VAR)
XML_MOO"M" (Mandatory) or "O" (Optional)
XML_TYPEMType: "BOOLEAN", "DATE", "DATETIME", "INTEGER", "NUMBER", "TEXT"
XML_FORMATORegex-Format: e.g. "(CALL,PUT)", "(true,false)"
XML_MIN_LENOMinimum length of content
XML_MAX_LENOMaximum length of content
XML_DEFAULTODefault value
XML_CONDITIONOCondition: e.g. "@ccy = Funds/Fund/Currency"
Mapping Sample
CSV_OPCSV_CONTENTCSV_TYPEXML_OPXML_CONTENTXML_TYPE
FIXSAMPLE.2019-01-10.12345TEXTMAPControlData/UniqueDocumentIDTEXT
VARNOWDATETIMEMAPControlData/DocumentGeneratedDATETIME
MAPNAV_DATEDATEMAPControlData/ContentDateDATE
FIXEUTEXTMAPControlData/DataSupplier/SystemCountryTEXT
FIXSDSTEXTMAPControlData/DataSupplier/ShortTEXT
FIXSample Data SupplierTEXTMAPControlData/DataSupplier/NameTEXT
FIXGenericTEXTMAPControlData/DataSupplier/TypeTEXT
FIXENTEXTMAPControlData/LanguageTEXT
CHANGELEITEXTLOOPFunds/Fund 
MAPLEITEXTMAPFunds/Fund/Identifiers/LEITEXT
MAPFUND_NAMETEXTMAPFunds/Fund/Names/OfficialNameTEXT
MAPFUND_CCYTEXTMAPFunds/Fund/CurrencyTEXT
FIXtrueBOOLEANMAPFunds/Fund/SingleFundFlagBOOLEAN
MAPFUND_LEGAL_STRUCTURETEXTMAPFunds/Fund/FundStaticData/ListedLegalStructureTEXT
More samples are available in the ZIP-file below.
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 versa
V1.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