From: Dan Nelson Date: November 17 2006 11:26pm Subject: Re: Importing Text File Into mySQL List-Archive: http://lists.mysql.com/mysql/203426 Message-Id: <20061117232647.GE7333@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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