flnMichael
Programmer
Hey guys,
I am trying to get a couple of lines of a text file and parse the lines into individual variables and output them in another formatted text file. Here's what I have so far:
and here's the portion of text I need to parse:
GCS SERIAL #: 0111
TEST STATION NUMBER: 555 TEST TYPE: SALE
OPERATION: 180
DATE: 06/03/02 TIME:11:02:58
PAYROLL NUMBER: t7419 TEST CODE: 1
QAP NUMBER: 759150 QAP REVISION: 58
I can get the single entry lines just fine, but it's the line where there are multiple entries I'm having trouble with. Pretty much every entry you see in this portion of text needs to be in a variable so I can easily output it in the next text file.
Any help would be appreciated.
Thanks
Mike
I am trying to get a couple of lines of a text file and parse the lines into individual variables and output them in another formatted text file. Here's what I have so far:
Code:
...previous code...
elsif($line =~ /^TEST STATION NUMBER:/)
{
$test_set_id =~ (/^TEST STATION NUMBER:\s*(.*)s+TEST TYPE:\s*(.*)/);
$test_set_id =~ s/\s+//g;
print "TEST_SET_IDENTIFICATION = $test_set_id\n";
}
and here's the portion of text I need to parse:
GCS SERIAL #: 0111
TEST STATION NUMBER: 555 TEST TYPE: SALE
OPERATION: 180
DATE: 06/03/02 TIME:11:02:58
PAYROLL NUMBER: t7419 TEST CODE: 1
QAP NUMBER: 759150 QAP REVISION: 58
I can get the single entry lines just fine, but it's the line where there are multiple entries I'm having trouble with. Pretty much every entry you see in this portion of text needs to be in a variable so I can easily output it in the next text file.
Any help would be appreciated.
Thanks
Mike