csv

  • Thread starter Thread starter Peter Kirk
  • Start date Start date
P

Peter Kirk

Hi

I am writing some code to generate csv from xml. This works fine in the
main, but I have a question regarding the handling of commas in the data.
What is the normal way to handle this?

For example, say part of the data in the xml is the string "a string , with
comma". The comma is confusing in the csv.

Likewise, when I generate the xml (which is then turned into csv) a double
value is written to the xml as the string "17,2" for example - as we are
running under Danish-culture. The comma here also confuses the csv.

Are there any general guidelines for handling these sorts of situations in
csv? We have thought about a semicolon as seperator instead, but then what
if data strings contain this character.....?

Thanks,
Peter
 
Hi,

You have to escape the "," that is part of a value.

Go to opennetcf.org they have a csv data provider and you can see/use the
parser.
 
Back
Top