[RndTbl] CSV files

John Lange john.lange at bighostbox.com
Mon Jul 12 22:59:52 CDT 2004

This really isn't a Unix question directly so I apologize for that.
However, I have a feeling that others here might have done something
like this.

I have a client who would like their data converted from Access to
mySQL. I'm using PHP to do the import because it plays so nice with
mySQL and I'm making some changes to the data while it is being
imported. So far so good, we are 90% there.

The problem is, Access does not export to a valid CSV format.
Specifically, if there are any text or memo fields in Access that happen
to contain CR/LF Access does not strip them or escape them in any way.
The results in a CSV file with end of line markers in the middle of data

At this point nothing I've found will import these files. Excel,
OpenOffice, even Access itself all treat the CR/LF as an end of record
marker even if it is enclosed in quotes.

I'm not doing the data exporting from Access and I'm not that familiar
with Access. Is there an option to strip CR/LF during export?

Any other suggestions on how to clean this data?


John Lange

More information about the Roundtable mailing list