I need a PHP solution to get rid of commas inside double quotes. I can't seem to figure out a solution using preg_replace.
I'm inserting data into a database from a text file that is coma delimited.
Certain columns from the text file contain multiple words that are surrounded in double quotes. Theses double quotes have comas inside, so when I attempt to insert the text into my database using coma delimited columns it reads in the quotes between the double quotes and turns them into columns.
Here is how a row in the text file looks:
partname,2035, "this is, desc,ription",qty, "another, description",
this is what happens when I attempt to separate it:
results partname, 2035, this is, desc, ription, qty, another, description,
this is what I want:
partime, 2035, this is description, qty, another description,
As you can see, the parts surrounded in double quotes should not be split into separate columns. I don't know how to fix this; could someone point me in the right direction?