Re: insert *.TAB into table
| From: | Vadee Prudon | Date: | Tue, 01 Aug 2000 13:21:47 +0000 |
| Subject: | Re: insert *.TAB into table | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9428@lists.php.net to get a copy of this message | ||
Hai,
I'm using an *.tab file and importing like ;
$fp = fopen ("$userfile","r");
while ($data = fgetcsv($fp, 10000, " ")){
$num = count($data);
$row++;
echo "<TR>";
for ($c=0; $c<$num; $c++){
echo "<TD>$data[$c]</TD>";
}
echo "</TR>";
So, what can I do best ?
Greetings, Vadee
"Boget, Chris" <Chris.Boget@wild.net> schreef in berichtnieuws
637C00F0303AD311BCCC009027887A7C420DEC@tiger.wild.net...
> > 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>