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!
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works Great! Thank you.
ASKER