Rewriting a textfile for import into a db..
| From: | Ryan Christensen | Date: | Tue, 07 Aug 2001 22:34:28 +0000 |
| Subject: | Rewriting a textfile for import into a db.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-61715@lists.php.net to get a copy of this message | ||
I have a few thousand entries that have been (until now) stored in
text-files that I need to get imported into a MySQL database for a new
system I'm writing that makes use of them. So.. the long and short of
it, I was wondering if someone could help me write a script (or supply
me with one.. Perl I'm guessing would be easiest) that can turn each
line in the text file from:
123|blah|foo|bar|etc
To be formatted like:
INSERT INTO Table VALUES (123,'blah','foo','bar','etc');
Thanks in advance.. any help would be appreciated!
Ryan