
Help on pattern matching, very diffcult one
[Posted and a courtesy copy sent.]
Quote:
> Please some one help me on this, it is somewhat complicate for me.
> You ( Tad and Larry ) were help me on simliar problem yesterday.
> However, this time the input is more complicated.
Not enough more complicated to make it necessary to tweak more than two
lines in my code.
Quote:
> Here is the sample of input files:
> A B C D E F G I J;
> 10XLHXXL1;
> 11XLHLXL1;
> 10LXXLXL1;
> 01LHHHXL1;
> the output should be:
> "column C stuck at L"
> "column E stuck at H"
> "column G stuck at X"
> "column I stuck at L"
> "column J stuck at 1"
How can that be the output? Column C is not stuck at L; column E is not
stuck at H.
Below is the revised program. The two commented lines are the previous
versions. The new version would have worked with the previous data
format also. TMTOWTDI.
You should be able to make such modifications yourself in the future.
#!/usr/local/bin/perl -w
use strict;
while (<DATA>) {
Quote:
}
print "column $_->[0] stuck at $keys[0]\n"
Quote:
}
__END__
A B C D E F G I J;
10XLHXXL1;
11XLHLXL1;
10LXXLXL1;
01LHHHXL1;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.*-*-*.com/