I am importing xls to mysql but need help on exploding the csv file.
the file is attached.
There may be lines like:
25AB300,2 x 3,"Flat poly bag 2""x3"" 4 mil 5,000/cs","5,000",8.0,40.0,4.84,$2.42,$12.10,$20.17,$17.29,$16.13,$15.13,$14.24
I need to explode it by the commas, but as you can see there are some fields that have commas in them that shouldn't be exploded.
It should basically be: explode by the comma but not if the field is enclosed by " ".
I cannot use mysql's infile for this one (which would have made my life easy).
What functions am I looking for.
Right now I'm using file_get_contents to get the file into a string and exploding that.