Home > Back-end >  C how to read the CSV file (have digital text) and its assignment to two-dimensional array?
C how to read the CSV file (have digital text) and its assignment to two-dimensional array?

Time:09-23

C + + how to read a CSV file (have digital text) and its assignment to two-dimensional array? Note how text and Numbers, how to write the code? Then if you want to put this array to cover back to file, how to operate? Thanks for detailed code

CodePudding user response:

Said too general

CodePudding user response:

reference 1/f, Simple, Soft reply:
said too general


Is a CSV file, there is a pile of data, such as this
0, 0, ABC, asdasda
Ads, asd, fedf, fw
Is likely to have Numbers may also have string
How to write c + + code to read the file, and put these data written to the string of two-dimensional array?
Then put the updated the string two-dimensional array output back in this file and override the original data flow of updating (omitted)
Ask these two function how to write the code?

CodePudding user response:

Line read, read a line, and then according to the comma, segmentation, endures in the array is ok, don't tube is Numbers or letters, all the same, read it out to make as a string
  • Related