Re: Inserting tab delimited textfiles into mysql

From: Date: Thu, 19 Dec 2002 13:53:09 +0000
Subject: Re: Inserting tab delimited textfiles into mysql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128855@lists.php.net to get a copy of this message
On Thursday 19 December 2002 19:31, Thomas Goeminne wrote: > I got a tab delimited file which looks like this: > > let us call it items.txt > > Type Catalog Number Item Description Side B Producer > 12 AAA502 Afu Ra-D&D Soundclash Mic Stance, Premeir,Curt Cazall > 12 AC725 Roc Raida/Wayne-O - Gong Show Burn That Ass Roc > Raida > > I want to take all this info and insert it into my mysql dbase. The type is > in a table named categories. The rest should go into the table named items. > With also the id number off the categorie in it. > > I have been looking for info on how to do this but I can't find a decent > article about it. First off I dump all the records which were already in > the dbase. And then it needs to get filled up with the new items.txt To get you started: 1) use file() to read in the text file 2) use explode(), with "\t" as the delimiter to split each line into their component parts -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* On-line, adj.: The idea that a human being should always be accessible to a computer. */

« previous php.general (#128855) next »