List:General Discussion« Previous MessageNext Message »
From:John Kopanas Date:November 18 2006 1:25am
Subject:Re: Re: Importing Text File Into mySQL
View as plain text  
I am trying to figure out how this would work?  How does LOAD DATA
figure out when one column begins and another ends when some of the
data are addresses with spaces in them?

On 11/17/06, Dan Nelson <dnelson@stripped> wrote:
> In the last episode (Nov 17), John Kopanas said:
> > I have a text file with over 500K rows of data in it.  The problem is
> > that the data is no seperated by commas but instead  occupy a certain
> > amount of characters.  So for instance:
> >
> > ID 1 -11
> > NAME 12-50
> > COMPANY_NAME 51-100
> > ...
> >
> > How would you parse import this data into mysql?
>
> Create a table that matches your layout exactly, then
>
> LOAD DATA ...
> FIELDS TERMINATED BY ''
> FIELDS ENCLOSED BY '';
>
> It's mentioned in one of the comments at
> http://dev.mysql.com/doc/refman/5.0/en/load-data.html
>
> --
>         Dan Nelson
>         dnelson@stripped
>


-- 
John Kopanas
john@stripped

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
Thread
Importing Text File Into mySQLJohn Kopanas18 Nov
  • Re: Importing Text File Into mySQLBruce Ferrell18 Nov
  • Re: Importing Text File Into mySQLDan Nelson18 Nov
    • Re: Re: Importing Text File Into mySQLJohn Kopanas18 Nov
      • Re: Importing Text File Into mySQLDan Nelson18 Nov
  • Re: Importing Text File Into mySQLVisolve DB Team18 Nov