Reading CSV(array data in "") and creating an XML
Posted: Wed Apr 06, 2011 1:15 pm
In some cases I have, the CSV has comma separated values in one column e.g. "ColumnAValue1","ColumnBValue1,ColumnBValue2,ColumnBValue3","ColumnCValue1,ColumnCValue2" is one row of the CSV file.
This has to be converted to XML as
<ColumnA>ColumnAValue1</ColumnA>
<ColumnB>ColumnBValue1</ColumnB>
<ColumnB>ColumnBValue2</ColumnB>
<ColumnB>ColumnBValue3</ColumnB>
<ColumnC>ColumnCValue1</ColumnC>
<ColumnC>ColumnCValue2</ColumnC>
I want my sequential view data to look as:
"ColumnAValue1","ColumnBValue1","ColumnBValue2","ColumnBValue3","ColumnCValue1","ColumnCValue2"
This kind of array "1","3","2" might vary to any in future.
How to handle this scenario within datastage.
This has to be converted to XML as
<ColumnA>ColumnAValue1</ColumnA>
<ColumnB>ColumnBValue1</ColumnB>
<ColumnB>ColumnBValue2</ColumnB>
<ColumnB>ColumnBValue3</ColumnB>
<ColumnC>ColumnCValue1</ColumnC>
<ColumnC>ColumnCValue2</ColumnC>
I want my sequential view data to look as:
"ColumnAValue1","ColumnBValue1","ColumnBValue2","ColumnBValue3","ColumnCValue1","ColumnCValue2"
This kind of array "1","3","2" might vary to any in future.
How to handle this scenario within datastage.