Detecting changes in an external file
I am helping a friend out with a rather large project and it involves taking these seemingly small files(under 10 mb) reading them in and then manipulating them using php with the overall goal to dump variables and so on into xml templates.
I can use php and regex to pick apart individual lines but where I seem to be hitting a brick wall is in detecting a change in the external file.
This friend has an archaic way of archiving/cataloging various newspapers in the bay area and is trying to move it from flat file(archaic notes/symbols, etc) to a relational DB.
We are wanting to read in a file, have it check for lines starting with [TAB] and [start box boh1]. As it sits we can parse out the box code from a [start box boh1] leaving just boh1. What I have loosely coded is a while loop to say that while box code = boh1 append each line starting with [TAB] with boh1. So what I am asking is am I going about this in the right way? Heres the code I have so far...
Any assistance is greatly appreciated.
$bc = "[start box BOH1]";
$bc1 = str_replace("[start box ","",$bc);
$box = substr($bc1,0,strlen($bc1)-1);
echo "<br />".$box;
while($bc = "[start box BOH1]"){
// newline variable .=" ".$box;
}
Do you want to make successes or excuses? Success? Alright then... See what's in store for you....
- The AC Assassin
Do you want to make successes or excuses? Success? Alright then... See what's in store for you....
- The AC Assassin