[PHP] read from flatfile and convert

2002-05-22 Thread r

Hey Guys,
Heres the deal,
I have a client who wants me to make a testimonials program for him,
Which is no problem till now, but now he has come with some additional
requirments that I dont know how to deal with...
he has a flatfile with a crap load of entries and he wants me to export it
into mySql!

Do any of you know what function to write to read a record from a flatfile
and write it to the database record for record?
doing it manually will be a pain in the --- but i dont want to lose the
chance for work...:-(
The flatfile was written using perl.
If need be I can give you the MyTestimonialsDB.txt file to screw around
with.

As usual, Any help appreciated.

Kindly reply,
Cheers,
-Ryan.

/*Don't steal. The government hates competition.*/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] read from flatfile and convert

2002-05-22 Thread Robert Cummings

r wrote:
 
 Hey Guys,
 Heres the deal,
 I have a client who wants me to make a testimonials program for him,
 Which is no problem till now, but now he has come with some additional
 requirments that I dont know how to deal with...
 he has a flatfile with a crap load of entries and he wants me to export it
 into mySql!
 
 Do any of you know what function to write to read a record from a flatfile
 and write it to the database record for record?
 doing it manually will be a pain in the --- but i dont want to lose the
 chance for work...:-(
 The flatfile was written using perl.
 If need be I can give you the MyTestimonialsDB.txt file to screw around
 with.

Depends on the format contained in the flat file... if it is some kind of
standard format then you may find a tool that does the job for you... more
than likely the format is custom and you'll need to do the grunt work
yourself - either by hand (small file) or by writing a script to do it for
you.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] read from flatfile and convert

2002-05-22 Thread 1LT John W. Holmes

How is the text file organized? Is it one testimonial per line? or is
there some other kind of seperator?

This should be easy. Use file() to read in the file, then do an insert for
each line. one little loop will load the whole file for you. how large of a
file is it?

---John Holmes...

- Original Message -
From: r [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 22, 2002 11:05 PM
Subject: [PHP] read from flatfile and convert


 Hey Guys,
 Heres the deal,
 I have a client who wants me to make a testimonials program for him,
 Which is no problem till now, but now he has come with some additional
 requirments that I dont know how to deal with...
 he has a flatfile with a crap load of entries and he wants me to export it
 into mySql!

 Do any of you know what function to write to read a record from a flatfile
 and write it to the database record for record?
 doing it manually will be a pain in the --- but i dont want to lose the
 chance for work...:-(
 The flatfile was written using perl.
 If need be I can give you the MyTestimonialsDB.txt file to screw around
 with.

 As usual, Any help appreciated.

 Kindly reply,
 Cheers,
 -Ryan.

 /*Don't steal. The government hates competition.*/




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php