Skip to Content

Convert .csv to xml on CPI

Hello,

we are having the follwoing challenge:

We are getting a .csv file which looks like this:

Filed1;Filed2;Filed3;Filed4;Filed5;Filed6;Filed7;Filed8;Filed9;Filed10;Filed11;Filed12;Filed13

Filed1;Filed2;Filed3;Filed4;Filed5;Filed6;Filed7;Filed8

Filed1;Filed2;Filed3;Filed4;Filed5;Filed6;Filed7;Filed8;Filed9;Filed10;Filed11;Filed12;

The first row will be just one time but row 2 and three can be there multiple times. We need to get this .csv to a xml structure to perform a mapping. Does any one has a idea how to solve this?

Regards

David

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 08 at 05:49 AM

    Hi David,

    Well, it depends on how the input file is structured. If the first row is the header, you can use the Standard CSV to XML Converter.

    First, you need to be clear about how the output should look like in XML, for example:

    <HeaderFiled1>
      <row>Filed1</row>
      <row>Filed1</row>
      ...
    </HeaderFiled1>
    <HeaderFiled2>
      <row>Filed1</row>
      <row>Filed1</row>
      ...
    </HeaderFiled2>
    

    You also need think about the columns without elements (looking at your example, row 2, "Filed9" is missing).

    Then from this target XML you can create an XML-Schema (.xsd) which the Standard CSV to XML converter needs. You can find examples for this online.

    Best regards

    Matti

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.