[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1209
  • Last Modified:

need to parse csv

How do I parse .csv file using MFC/C++
0
netformx
Asked:
netformx
3 Solutions
 
pallospCommented:
What about this?
http://www.mayukhbose.com/freebies/c-code.php##csv

The author says his code is compatible with both Linux and Visual C++ in Windows.
0
 
pallospCommented:
Another parser found at codeproject.com:
http://www.codeproject.com/string/splitstring.asp
0
 
contactkarthiCommented:
piece of code to get the csv data in the form of an array
http://www.codeguru.com/cpp/cpp/algorithms/strings/article.php/c8153/
0
 
TelavianCommented:
Parsing CSV data is nothing more than breaking it up into pieces. A solution using STL is given at
http://www.codeproject.com/vcpp/stl/tokenizer.asp

All you want to do it split or tokenize the string on the delimeter character. Once these pieces are produced then scan through each piece to identify which pieces should be combined because they had the delimeter inside a quoted section. To identify this scan through each piece and see if it has a quote character. If it does then scan until you find the piece that ends the quote and combine the pieces.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now