Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSV(Comma Separated Files)VC++

Status
Not open for further replies.

kalyankar

Programmer
Mar 20, 2002
4
0
0
US
Hi there,

I need to use to read and write CVS (comma Separed Values file).Would someone please help me out.

Thanks in advance for any suggestion.
Dev
 
Hi,

I would suggest you to open the file as an ifstream then read each line into a string (or CString) until EOF. Use getline() instead of >> to read till End of Line, not till the first whitespace.
then iterate through the string with strstr(...) or (Find)to locate the commas and split the string up with strncpy (Mid).
Hope this helps you

Branko
 
In the past I have written some C++ classes to handle CSV strings and files.

If it is of any help I can make the sources available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top