List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 16 1999 12:40pm
Subject:Re: does LOAD DATE INFILE ... support position delimited column
fields
View as plain text  
>>>>> "Bob" == Bob Kline <bkline@stripped> writes:

Bob> On Thu, 28 Oct 1999, Thanh Hoang Chu wrote:
>> I have a huge datafile.txt which contains records that I want to
>> parse into MySQL using command LOAD DATE INFILE. The fields of the
>> records are delimited (positioned) by fixed positionings, rather
>> than character occurances like ' or " or ,. I have been looking
>> around, but couldn't find the syntax for the options of command LOAD
>> DATA INFILE .. to set the positions of the columns in the
>> datafile.txt. Oracle does support positioning of record fields when
>> using sqlloader. I wonder if MySQL does support this. If someone
>> does know, please let me know.
>> 

Bob> If you look through the archives for this mailing list you'll see that
Bob> this question has been asked before, and I believe you'll even find some
Bob> Perl code that was posted for converting fixed-length flat files into a
Bob> format suitable for LOAD DATA.  To help you with your search, you should
Bob> be aware the the terms "delimited" and "fixed-length" do not mean the
Bob> same thing.  "Delimited" generally refers to the use of special
Bob> characters ("delimiters") used to denote boundaries between data
Bob> elements.

Hi!

LOAD DATA INFILE can actually handle fixed length datafile:S as long as 
the field 'display' length exactly matches the ones in the data file.

Just set all of FIELDS TERMINATED BY, LINES TERMINATED BY and
ESCAPED_BY to "".

Regards,
Monty

PS: Sorry for the long delay before replying, but I just come back from
    a 2 weeks vacation trip.
Thread
does LOAD DATE INFILE ... support position delimited column fieldsThanh Hoang Chu28 Oct
  • Re: does LOAD DATE INFILE ... support position delimited column fieldsBogdan Paduraru28 Oct
  • Re: does LOAD DATE INFILE ... support position delimited columnfieldsBob Kline28 Oct
    • Re: does LOAD DATE INFILE ... support position delimited columnfieldsMichael Widenius18 Nov
  • Re: does LOAD DATE INFILE ... support position delimited column fieldsShayne Hughes28 Oct
RE: does LOAD DATE INFILE ... support position delimited column fieldsIndrek Siitan28 Oct