How to write a value which contain comma to a CSV file in c#?

前端 未结 6 1365
时光取名叫无心
时光取名叫无心 2021-01-01 14:58

I am using a data table for storing data.

I am exporting the data from data table to CSV file.

Sometimes there may be values containing comma(,)

6条回答
  •  时光说笑
    2021-01-01 15:25

    Write Comma separated value between double quote without space to create csv with single column for comaa separated values.

    Ex. I have two columns Code & Description With Values Code01 & Val1,Val2,Val3. To create csv with given data write below line in notepad and save it with csv extension.

    Code,Description
    Code01,"Val1,Val2,Val3"
    

提交回复
热议问题