RE: [PHP] insert *.TAB into table
| From: | Boget, Chris | Date: | Tue, 01 Aug 2000 13:15:41 +0000 |
| Subject: | RE: [PHP] insert *.TAB into table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9427@lists.php.net to get a copy of this message | ||
> I got the next problem, I'm exporting an *.TAB file out of my
> database. When I have an empty field in my database he will
> put an double tab. But when i'm importing this tab file into
> MySQL database he doesn't see the double tab and all my data
> is messed up. Is there a way to let my php recognize an double
> tab as an empty data field ?
First, how are you importing the data into the DB? Are you
parsing each line as a record? Are you using mySQL's "LOAD
DATA INFILE" functionality?
If you are running though each line yourself and pulling each
field from each record, one thing you can do prior to this is
do an ereg_replace() on double tabs (\t\t) and convert them
to a "tab space tab" so when you come across a space, you know
it is an empty field.
Chris