|
Posted by torpecool on 10/23/98 11:40
Hello Everyone,
I have a situation that I just cannot wrap my head around. I would
appreciate any ideas or suggestions.
I am trying to parse and load a tab delimited file into a mysql
database. The file is generated by a scientific instrument. One file
contains the records of several people. Each person's information is
in 3 consecutive lines of the file.
A simplified demonstration:
id | test | result
1 | test1 | 50
| test 2 | 55
| test 3 | 60
2 | test 1 | 10
| test 2 | 15
| test 3 | 20
etc.
When I load this information into the database, it should have this
format
id | test 1 | test 2 | test 3
1 | 50 | 55 | 60
2 | 10 | 15 | 20
I'm okay with setting up the database, that's no problem.
I am however rather new to PHP and although I know I have to use the
explode() function to break this array down into its parts, I'm not
exactly sure how. Specifically, one file could contain the records of
up to 20 people, and I am not sure how I can loop through this file
(loaded into an array) in order to capture all of this info.
I hope I've given enough information to make sense. Again, any ideas,
examples or suggestions would be appreciated.
Thanks,
Andy
[Back to original message]
|