Hi all,
a fellow of mine found already the answer:
"M1000C1" string can be found in many lines, therefore many sections are found...
You need to use the bounderies notation (word bounderies):
solution for 2) use \b<searchpatter >\b
[kilian_koala]sharan:~/tmp/koala/nokkcc (193) % perl -ne 'print if /\bM1000C1\b/ .. /<\/Counter>/' nokrwwKOALA.xml
...
User Profile
Collapse
-
perl -e matching lines between two search patterns - not working
Hi,
I have a tricky question!? :-)
I'm using the perl -e command in order to match lines between two search patterns. The problem I have is, for the first example it is working, for the second not, but I can't see the difference:
1) ok:
[kilian_koala]sharan:~/tmp/koala/nokkcc (171) % perl -ne 'print if /M1000C0/ .. /<\/Counter>/' nokrwwKOALA.xml
<Counter ID="ave_prxtot_ class_0"...
No activity results to display
Show More
Leave a comment: