At 11:01 +0100 12/19/02, Gianluca Carnabuci wrote:
Hi,

I've been trying to import a huge .txt file into a MySql table. In the .txt file, missing values are recorded as empty cells (it might be that there's some hidden character instead, but I wouldn't know how to figure that out). When I LOAD DATA INFILE, MySql writes the missing values as zeros, rather than nulls. I can't UPDATE these zeros as nulls after loading the data, because some of the data are actually zeros in the original .txt file.
Do you have any suggestions?

Gianluca
Hmm, that's kind of difficult.  You say there might be some hidden characters,
but you don't know for sure.  How could anyone else know, then? :-)

If you can determine either that there is some hidden character, or
that the fields are in fact empty, you might try preprocessing your
file to replace them with \N (backslash capital-N, no quotes), which
LOAD DATA will interpret as a NULL values.

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to