C
Chris Kolosiwsky
<de-lurk>
Hello all,
Given the script listed below:
LINE: while (<>)
{
while (! m/.+?<endad>/){
if(m/<cat
\d+)>/) {
$cat = $1;
}
if($cat =~ /^14/) {
if(m/(>(.+?)<endad>)/) {
print $cat . "\|" . $2 ."\n";
}
}
next LINE;
}
}
and the data format as:
<cat:nnnnn>
<some useless discarded text>
<logo:>TEXT that I want to keep<endad>
(each line is seperate)
and this is the expected output:
nnnnn|TEXT that I want to keep
Is there any reason that this script should function fine in files
that use a \x0d\x0a between lines instead of just a \x0d?
The script gives the expected output in the CR/LF scenario, but int he
CR case, I get nothing.
I'm exceptionally sorry if this is listed in the faq, but a perldoc -q
"carriage return" returned zip.
TIA
Chris
<re-lurk>
Hello all,
Given the script listed below:
LINE: while (<>)
{
while (! m/.+?<endad>/){
if(m/<cat
$cat = $1;
}
if($cat =~ /^14/) {
if(m/(>(.+?)<endad>)/) {
print $cat . "\|" . $2 ."\n";
}
}
next LINE;
}
}
and the data format as:
<cat:nnnnn>
<some useless discarded text>
<logo:>TEXT that I want to keep<endad>
(each line is seperate)
and this is the expected output:
nnnnn|TEXT that I want to keep
Is there any reason that this script should function fine in files
that use a \x0d\x0a between lines instead of just a \x0d?
The script gives the expected output in the CR/LF scenario, but int he
CR case, I get nothing.
I'm exceptionally sorry if this is listed in the faq, but a perldoc -q
"carriage return" returned zip.
TIA
Chris
<re-lurk>