Page 1 of 1

read csv file

Posted: Tue Aug 04, 2009 2:58 am
by lordrt
I want to read a csv file in the following format line-by-line:

line1. 1,2,3,4,5,6,7,8,9,10
line2. 11,12,13,14,15,16
.
.
lineN. (some values)


Can anyone help plz :?:

Re: read csv file

Posted: Tue Aug 04, 2009 3:05 am
by Luke

Re: read csv file

Posted: Tue Aug 04, 2009 3:35 am
by lordrt
thx but am reading but getting confused. Do I have to specify which delimiter is being used? When reading a normal file we use fgets to read a line, is fgetcsv same as fgets? :|

Re: read csv file

Posted: Tue Aug 04, 2009 9:31 am
by towerspl
the link he provided explains everything on the page

Similar to fgets() except that fgetcsv() parses the line it reads for fields in CSV format and returns an array containing the fields read.


try reading a little