List:General Discussion« Previous MessageNext Message »
From:Rory McKinley Date:September 27 2005 6:41am
Subject:Re: Another LOAD Infile Problem
View as plain text  
Jason Ferguson wrote:
> The data is split into about 60 files, average file size of 5 MB (varying
> from 1 to 10 MB). Since there are many files, I'm trying to minimize the
> required work (if there was just one consolidated file, no problem).
> 
> Jason
<snippety-snip>

Hi Jason

If it's not too late (aren't timezones wonderful?) ;).

Have you considered using an interim table into which you load your file
in its entirety? Load all fields and have each field set to something
like CHAR or VARCHAR big enough to accommodate the fields in the file.
Then just pick the columns that you are interested in:

Then you can do a :

INSERT INTO final_table (col_1, col_2..col_n)
SELECT col_1, IF(col_3="unknown", 0, col_3) AS col_2
FROM interim_table
....

Also means that you don't have to necessarily upgrade to 5.x (as per
your previous problem) - unless you want to, of course ;)

Regards

Rory

Thread
Another LOAD Infile ProblemJason Ferguson27 Sep
  • Re: Another LOAD Infile ProblemJasper Bryant-Greene27 Sep
    • Re: Another LOAD Infile ProblemJason Ferguson27 Sep
      • Re: Another LOAD Infile ProblemRobert L Cochran27 Sep
      • Re: Another LOAD Infile ProblemRory McKinley27 Sep
      • Re: Another LOAD Infile ProblemJigal van Hemert27 Sep
    • Re: Another LOAD Infile ProblemRobert L Cochran27 Sep
  • Re: Another LOAD Infile ProblemSGreen27 Sep