Topic Thread

Expand all | Collapse all

Simple Java Utility to Convert CSV to MDM XML

  • 1.  Simple Java Utility to Convert CSV to MDM XML

    Posted Thu May 30, 2019 12:35 PM
    I have written a simple Java utility to convert CSV files to MDM XML

    The use case is to convert source system extracts to MDM XML files which can then be loaded into MDM use the Batch processor.

    It can easily handle millions of rows... Used on a recent project to perform initial load of 2M parties.

    Extract from the readme file:

    ###

    Extract to folder and run as follows:

    java -cp "bin" ConvertToXML <TemplateFile> <CSVSourceFile> <ConfigFile> <OutMDM_XML_File>
    eg
    java -cp "bin" ConvertToXML maintainPartyTEMPLATE.xml sourceA.csv configA.txt mpSourceA.xml


    This will run the "ConvertToXML" class.

    The arguments are 4 file names as follows:

    <TemplateFile> : this is the "seed" MDM XML file containing a single instance of the MDM transaction to be run.
    Place holders like "AAA_SSN" will be replaced by values from the CSV source file.

    When putting in tags for Address these are mandatory : AddressLineOne, City, ZipPostalCode. ProvinceStateType is optional.
    If it is not supplied, then ConvertToXML will simply remove this tag from Address, leaving AddressLineOne, City and ZipPostalCode


    <CSVSourceFile> : this is a PIPE delimited file containing the source data. A business key can be contained : this
    is mandatory and used to populate the AdminSysKey if the maintainParty txn is being used. However ANY MDM XML
    transaction can be used, such as addPerson etc.

    It is not necessary for each line in the CSV file to have every field populated. Blank entries will just result in the
    corresponding XML line in the output XML being removed.

    <ConfigFile> : this contains value pairs of column number and substitution values. For example, if SSN is in the 5th column
    in the CSVSourceFile, then the ConfigFile will contain this value:

    ###

    Please contact me for further details, or download from Box:

    https://ibm.ent.box.com/folder/72435376502

    Thanks!

    ​​

    ------------------------------
    Ian Dallas
    InfoSphere MDM Lead Technical Architect (IBM SWG, EMEA Services)
    IBM Cloud and Cognitive Software
    ------------------------------


  • 2.  RE: Simple Java Utility to Convert CSV to MDM XML

    Posted Fri May 31, 2019 09:03 AM
    Ian, 
    it seems that the Box folder is not accessible (at least not for me). Could you check please?
    Thanks!

    ------------------------------
    ROBERT KENDE
    Madrid
    ------------------------------



  • 3.  RE: Simple Java Utility to Convert CSV to MDM XML

    Posted Fri May 31, 2019 09:23 AM
      |   view attached
    I have uploaded the full RAD project...

    ------------------------------
    IAN DALLAS
    ------------------------------

    Attachment(s)

    zip
    ConvertToXML.zip   18K 1 version