[thelist] Question on importing textfile into mySql

Steve Cook sck at biljettpoolen.se
Thu Dec 21 03:16:21 CST 2000


Hi Ari,

here's the section in the mySQL manual that you want:
http://www.mysql.com/documentation/mysql/bychapter/manual_Tutorial.html#Load
ing_tables

This describes how you can load a database directly from a csv file.

Alternatively, you could write a script that parses your mail file and loads
the contents into the database using INSERT queries. That way you can do any
extra processing you may wish to perform on the content. I use a similar
method on my mailing list site to read the text based archive from the list
and create a database driven version  It's a perl script that is run using
cron every hour and which strips out unwanted headers, escapes characters
etc.

Try and explore the mysql online manual as much as possible. There are
versions to download as well. I've found that although I have a mySQL and
PHP book, the mySQL manual is indispensible and (imho) very well laid out.

.steve


----------------------------------
   WapWarp - http://wapwarp.com
 Wap-Dev - http://www.wap-dev.net
 Cookstour - http://cookstour.org
----------------------------------

> -----Original Message-----
> From: Herzog, Ari [mailto:Ari_Herzog at Instron.com]
> Sent: den 20 december 2000 18:18
> To: 'thelist at lists.evolt.org'
> Subject: [thelist] Question on importing textfile into mySql
> 
> 
> Hi. For my personal site at home, I recently bought a new 
> domain so I can
> shift operations of one of my sites to this new domain, and I will be
> learning mySQL and PHP to do this effectively. Anyway, I just 
> created the
> table last night with phpadminwizard and I was wondering how 
> easy it is to
> import a textfile?
> 
> If I use a message parsing program (which I have) to parse 
> emails to a CSV
> file,
> can I then easily import that file into the table so I don't 
> have to write
> it line by line?
> 
> Thx,
> Ari
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 
> 




More information about the thelist mailing list