Link to home
Start Free TrialLog in
Avatar of cPokey
cPokey

asked on

Breaking up a data file

I am trying to write a php script that will read in a text based data file. Find the start of the first set of data and the End of the first set. Then make the changes that it needs to make, move the changed data to another var, and then go to the next set of data and then add append that data to the first set of data and repeat till the end of the file.

Below is an example of the data format. The data is separated by 3 blank lines. If i break the data into separate parts, I can do what I want.  But I need to read it as one file.

Any suggestions on the best way to do this?  Thanks!
startdata
data
data
data
data
enddata
 
 
startline
data
data
data
data
data
endline
 
 
startline
data
data
data
endline

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of bljak
bljak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cPokey
cPokey

ASKER

Works Great.  Thank you!
Avatar of cPokey

ASKER

Works Great! Thank you.