Gurus,
I need advice on how to best parse a file I receive from an outside vendor. A vendor tests our electronic components and their software outputs test data onto very loosely formatted flat files.
I have been successful extracting other info from the same file using strstr() by loading the file and reading it line by line.
$text = file($filename);
foreach($text as $string)
{... }
I hit a roadblock with the following section that's across multiple lines:
****** Component Test - Receiver ID ****^M
^M
FA0300^M
^M
F003^M
F2030C000000080607040903020301^M
Receiver ID read from STB:^M
000867493231^M
Receiver ID read from label:^M
^M
000867493231^M
Internal Receiver ID matches the label^M
^M
****** Component Test - Model Number ****^M
The challenge is that I need to extract and write to another file the portion of text going from "Receiver ID read from STB:" to "...matches the label".
I tried using strtok() with the hidden M characters Emacs shows me but got nowhere.
Any advice how to best do that?
Thanks,
Al.