How do I handle line breaks in a CSV file using C#?

前端 未结 14 1920
情书的邮戳
情书的邮戳 2020-12-15 08:43

I have an Excel spreadsheet being converted into a CSV file in C#, but am having a problem dealing with line breaks. For instance:

\"John\",\"23\",\"555-555         


        
14条回答
  •  臣服心动
    2020-12-15 09:21

    Read the line.
    Split into columns(fields).
    If you have enough columns expected for each line, then process.
    If not, read the next line, and capture the remaining columns until you get what you need.
    Repeat.

提交回复
热议问题