List:General Discussion« Previous MessageNext Message »
From:Bruce Ferrell Date:November 17 2006 11:25pm
Subject:Re: Importing Text File Into mySQL
View as plain text  
I did a little shell script to do it.  the key was the shell variable IFS:

Normally IFS=" "

to make it work right I set it as follows:

IFS="
"

Yes, thats a newline between the quotes


John Kopanas wrote:
> 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?
> 
> Thanks for your help :-).
> 

-- 
One day at a time, one second if that's what it takes

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