8 messages in com.mysql.lists.mysqlRe: Another LOAD Infile Problem
FromSent OnAttachments
Jason Ferguson26 Sep 2005 19:57 
Jasper Bryant-Greene26 Sep 2005 20:03 
Jason Ferguson26 Sep 2005 20:07 
Robert L Cochran26 Sep 2005 20:12 
Robert L Cochran26 Sep 2005 20:18 
Rory McKinley26 Sep 2005 23:41 
Jigal van Hemert27 Sep 2005 00:14 
SGr...@unimin.com27 Sep 2005 05:50 
Subject:Re: Another LOAD Infile Problem
From:Rory McKinley (ror@nebula.co.za)
Date:09/26/2005 11:41:10 PM
List:com.mysql.lists.mysql

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).

<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