Hi all,
I'm trying to grab data from a txt file. I can find the lines I want but having problems because the txt file wraps the text and I cant unwrap it!
Here's some sample code I've been playing with.
=======
#!c:/perl/bin/perl -w
use strict;
open(SURVEY, "c:\\compaq\\survey.txt") || die "Sorry, there was a problem opening the file.\n";
while (<SURVEY>) {
if(m/^Firmware Revisions(.*?)(\d\d\/\d\d\/\d\d)$/sgm) {
print $_;
}
}
close(SURVEY);
=======
The regex should find a line starting with "Firmware Revisions" and then ignore everything until it see's a date in brackets "(10/10/04)"
The date is on the next line. And thats my problem. I've googled and read up on the subject. Think I'm getting near but the deadline for this script is just about to whoooosh on by...
So any help would be fab!
I'm trying to grab data from a txt file. I can find the lines I want but having problems because the txt file wraps the text and I cant unwrap it!
Here's some sample code I've been playing with.
=======
#!c:/perl/bin/perl -w
use strict;
open(SURVEY, "c:\\compaq\\survey.txt") || die "Sorry, there was a problem opening the file.\n";
while (<SURVEY>) {
if(m/^Firmware Revisions(.*?)(\d\d\/\d\d\/\d\d)$/sgm) {
print $_;
}
}
close(SURVEY);
=======
The regex should find a line starting with "Firmware Revisions" and then ignore everything until it see's a date in brackets "(10/10/04)"
The date is on the next line. And thats my problem. I've googled and read up on the subject. Think I'm getting near but the deadline for this script is just about to whoooosh on by...
So any help would be fab!