List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 19 2002 6:08pm
Subject:Re: Missing values
View as plain text  
At 11:01 +0100 12/19/02, Gianluca Carnabuci wrote:
>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?

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.
Missing valuesGianluca Carnabuci19 Dec
  • Re: Missing valuesQunfeng Dong19 Dec
  • Re: Missing valuesPaul DuBois19 Dec