Importing Data from Text File

From: Date: Wed, 18 Apr 2001 05:12:23 +0000
Subject: Importing Data from Text File
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-49120@lists.php.net to get a copy of this message
Hi Everyone, Ive been asked to do a task here at my work and its something ive never done before. I was hoping you guys could point me in the right direction so I can research some more and discover how in the hell im gonna do this :) Basically, I have been issued a TAB delimited text file which I need to process and insert all the data into a table. Here is a basic example of what I need to do.......... Say the text file had the following lines (thousands of them, 1 record per line)
Screw   Big     12      200     1.99
Screw   Big     10      400     1.50
And I wanted to import each line into a table (Mysql DB) that had 6 fields (5 for each of the above plus an autoincremented ID field stock_id stock_name stock_desc stock_length stock_qty stock_price Any suggestions and direction pointing will be greatly appreciated. --
      Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: chris@ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
            --------------------------------------------
      Unix -- because a computer's a terrible thing to waste!


« previous php.general (#49120) next »