To: Leotta, Natalie (NCI/IMS)
Cc: 'Kelvin'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] How to insert to DB from txt??? Please help
egrep_split? But then, there's the learning curve for grep...
On Fri, 4 Jan 2002, Leotta, Natalie (NCI/IMS) wrote:
There are a few ways to split up text
How about
LOAD DATA INFILE 'filename.txt'
INTO TABLE Table
FIELDS TERMINATED BY ',' comma delimited for tabs use '\t'
LINES TERMINATED BY '\n' *nix line terminator, for Dos/Win use
'\r\n'
IGNORE 1 LINES use if the first line of the file has col.
hdrs.
On Saturday 05 January 2002 00:44, Kelvin wrote:
Hi everyone,
I have a txt file which is contained the following:
,aaa,ccc,ddd
,aaa,ccc,ddd
.etc.
Now, I need to read the data from that file and than insert it into the
table.
insert into
egrep_split? But then, there's the learning curve for grep...
On Fri, 4 Jan 2002, Leotta, Natalie (NCI/IMS) wrote:
There are a few ways to split up text based on a delimiter. I recommend you
look at split and explode on the PHP.net site and see what seems to be best
for your situation.
you should maybe try the free dbtools mysql program from
http://www.dbtools.com.br
this can handle text file imports direct into a mysql db , also it can
import or export from excell , access, paradox, foxpro , dbase or odbc data
sources, very handy tool if all you ever use it for is the transfer