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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

csv file

Status
Not open for further replies.

beginner222

Programmer
Sep 20, 2006
2
hey guys,
i am trying to read a csv file into an 3d array.

the file format is the following:
ABC,"12 aug 2006",323.343,5454,4545.4545.4545...
..
...
...
...

for 762 rows and 7 columns.

how can i read this file into a 3D array, one for the column one for the rows and one for the length of the stream..

thanks guys.
 
Well you could use fgets() to read each line and strtok() to break out each field from each line and malloc() with strcpy() to transfer the strings into your array ... as I pointed out on thescripts forum.

==========================================
toff.jpg
Some cause happiness wherever they go; others whenever they go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top