Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP parsing Text files

Status
Not open for further replies.

Hawki

Programmer
Oct 16, 1999
63
US



Hi

I have been able to use PHP to read a text file with each records in the file have 400 characters on each line. How do I get it to brake the information down into fields when the data looks like this:
Centermetro00203440554223304Mytime0550224035045t4034023423
While parsing the record the information needs to be saved to be imported into MS Access or Oracle tables
 
either you need to change your text format to use csv or some other method of delineating records and fields within records or you must rely on the fields each being fixed length or definiitively differentiable on pattern.

for fixed length use substr. for patterns use preg_match()
 
Do you have any control over how the information is written into the text file ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top