I need to create a single page that allows a user to import a CSV text file into a database, replacing everything there. Its coming from an exporting function in a different program. Now I can do this with the fscanf function but I run into formatting problems.
I can run the following:
fscanf ($handle, "%s;%s;%s...\n")
it will import the correct number of rows. However, all fields will be empty (database is mysql).
I'm running into a problem with the field formatting. Here's a sample from my data:
"130673";"RTE 7 STAR PROJECT";"D.AHMADZAI";"1";2003/08/15 0:00:00;1.0e-03;"SCHENECTADY";;"Z01";;;"180674, STAR"
Fields are separated by ';'. Notice how not every field is surrounded by a " ". My question is, how can a strip out the " " or handle them properly so I can allow this user to import all data????
Thanks,
Ben