cancel
Showing results for 
Search instead for 
Did you mean: 

Convert .csv to xml on CPI

davidschievers
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

mattisebastian
Participant
0 Kudos

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