I used php-csv-parser for to parse my csv files in my site. in my csv file I have list of numbers for to store in table.
if I create the csv file in openoffice.org it works fine. in case I created the csv files using ms office it creates a problem.
in my csv file I have numbers like below,
1001
1002
1003
1004
if I give like,
1,1001
2,1002
3,1003
above also works fine when I store csv in openoffice.org.
but I created the above format in msoffice csv file it won’t parse correctly.
when I print that array it shows like,
Array
(
[0] => Array
(
[0] => 1
[1] => 1000000001
2
[2] => 1000000002
3
[3] => 1000000003
4
[4] => 1000000004
5
[5] => 1000000005
)
)
it shows all the records in one array.
now I need if the csv is created in anyformat with, or normal I need to parse the values correctly.
like every data’s parse as each record, not like above.
else can you please suggest me any other csv parser?.
I found the alternate CSV parser.
try this one http://code.google.com/p/parsecsv-for-php/
it works great. if i create datas in notepad and saved it as a CSV. that also working fine. it parse as each row as a record even i give row values with (,). like,
1,20
2,21
3,22
4,23
it parses the file and give value as array like,