LOAD DATA - linefeeds within fields
Posted: Sun Apr 06, 2003 11:30 pm
I'm stumped with a LOAD DATA problem with linefeeds inside fields.
When I export a tab file from a FileMakerPro database where some fields have new lines (addresses etc - I know but that's the way my client has it set up) the linefeeds seem to get lost after a LOAD DATA.
I've tried every configuration of LOAD DATA I can think of (terminated by, etc) and every output variation from FileMakerPro (Windows, Dos, Mac character sets, csv rather than tab) but always when I look at the mysql db in phpMyadmin after a LOAD DATA it's got funny little squares which can't be nl2br()'d.
If copy paste direct from the FileMakerPro database into phpMyadmin the linefeeds are maintained and nl2br() works fine. That's not a practical way to deal with hundreds of records though.
If I open the tab or csv file in Word the linefeeds are there (you know, the backwards arrow symbol).
If I open the tab file in edit plus there are funny little squares again. I can find replace these with <br /> before LOAD'ing DATA (which works) but I'd rather not have to do that (a client will be maintaining the site and I want to keep the update routine as simple as possible).
ord("the square symbol") returns 11
Any help gratefully appreciated.
When I export a tab file from a FileMakerPro database where some fields have new lines (addresses etc - I know but that's the way my client has it set up) the linefeeds seem to get lost after a LOAD DATA.
I've tried every configuration of LOAD DATA I can think of (terminated by, etc) and every output variation from FileMakerPro (Windows, Dos, Mac character sets, csv rather than tab) but always when I look at the mysql db in phpMyadmin after a LOAD DATA it's got funny little squares which can't be nl2br()'d.
If copy paste direct from the FileMakerPro database into phpMyadmin the linefeeds are maintained and nl2br() works fine. That's not a practical way to deal with hundreds of records though.
If I open the tab or csv file in Word the linefeeds are there (you know, the backwards arrow symbol).
If I open the tab file in edit plus there are funny little squares again. I can find replace these with <br /> before LOAD'ing DATA (which works) but I'd rather not have to do that (a client will be maintaining the site and I want to keep the update routine as simple as possible).
ord("the square symbol") returns 11
Any help gratefully appreciated.