I am using MySQL (4.1.0-alpha-max-nt) on Windows 2000.

I'm trying to read a text file that looks a bit like this:
     40 3 10 M000 CCCC... 1000... ACBB... MMMM...
where the ... indicate more characters. I've created the
following table to store this data
(
   id int NOT NULL,
   year INT NOT NULL,
   test INT NOT NULL,
   elig CHAR(4) NOT NULL,
   writing CHAR(9) NOT NULL,
   spelling CHAR(36) NOT NULL,
   reading CHAR(30) NOT NULL,
   numeracy CHAR(38) NOT NULL
);

The character fields are all fixed width, but the first
integer field has some leading spaces. When I try LOAD DATA
INFILE the results are pretty much rubbish:
|   40 |    0 |    0 | 1100 | 110000001 | 11111000000000000 
ACBBDCBBAADDDCABDA | ABDBACABAACC MMMMMMMMMMMMMMMMM | 
MMMMMMMMMMMMMMMMMMMMM

Can I change something in my CREATE TABLE statement or add
some options to LOAD DATA so that I can read the file as it
is? Or must I pre-process it to zero-fill the first field?
Thanks for your advice.


Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to