reading multiple variable types from single line in file C

后端 未结 5 1205
无人及你
无人及你 2021-01-27 14:09

Alright I\'ve been at this all day and can\'t for the life of me get this down, maybe you chaps can help. I have a file that reads as follows

1301,1055150

5条回答
  •  孤街浪徒
    2021-01-27 14:35

    What you have there is a CSV file with quoted strings, and so I would recommend you use a CSV parser (or roll your own) rather than trying to do it all with scanf (since scanf cannot deal with quotes, e.g. commas within quoted strings). A quick Google search turns up libcsv.c which you may be able to use in your project.

提交回复
热议问题