Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CSV to XML with extra commas

Hi

I'm importing a CSV to XML using text loader and Flat File Parser, then using StringListToXML parser on each line of my input.

This has delimeter set to "," and strip quotes=true.

My problem is it doesn't seem to be able to handle it when some of the values have embedded quotes, so for example

"1","abc","abc,def","blah"

which should come out as

<row><item>1</item></row>

<row><item>abc</item></row>

<row><item>abc,def</item></row>

<row><item>blah</item></row>

actually comes out as

<row><item>1</item></row>

<row><item>abc</item></row>

<row><item>abc</item></row>

<row><item>def</item></row>

<row><item>blah</item></row>

Any Ideas? I have no control over the source CSV.

Remember if you are trying this you'll have to escape the quotes in the "Input" of the parser, thus "\"1\",\"abc\",\"abc,def\",\"blah\""

Thanks

Nick

PS

xMII version 11.5.3 b66

Server Plug in 1.4.2_06 build b03

Client Plug in 1.6.0_02

Former Member
replied

Nick,

Try setting the Delimeter to:

doublequote & ","

Hope this helps.

-Sam

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question