Help on pattern matching, very diffcult one 
Author Message
 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/



Sun, 04 Nov 2001 03:00:00 GMT  
 Help on pattern matching, very diffcult one
Hi,

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.

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"

I really appreciated your help.

--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---



Mon, 05 Nov 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. combine two pattern matches to one match?

2. help with pattern match (repeated patterns)

3. Pattern matching spanning more than one line and substitution between two files -

4. pattern matching; see content file as one string

5. Pattern Match - Don't Understand this particular one

6. Which one is the best (pattern matching)

7. Matching pattern in more than one line !

8. HELP: Need help with "pattern matching"

9. HELP: Pattern matching. - Thanks to all who helped :)

10. Regular Expressions/Pattern Matching/Unordered pattern

11. pattern as a sentence in pattern matching

12. Need help on pattern matching

 

 
Powered by phpBB® Forum Software