M
Magnus
Hi!
Lets say I have a logfile which looks like:
Text bla bla...
Text....
foo1
More text bla bla...
Even more...
bar1
Text again...
foo2
and more..
bar2
bla bla..
I know (I think) how to print foo1 and bar1 and whats between:
while(<>){
if (/foo1/ .. /bar1/) {
print $_;
}
}
But what if I want to search the file all over again and print foo2
and bar2 and whats between and how do I remove the printed lines from
the logfile?
Any help is appreciated, even if it is just a hint.
Thanks in advance!
Magnus
Lets say I have a logfile which looks like:
Text bla bla...
Text....
foo1
More text bla bla...
Even more...
bar1
Text again...
foo2
and more..
bar2
bla bla..
I know (I think) how to print foo1 and bar1 and whats between:
while(<>){
if (/foo1/ .. /bar1/) {
print $_;
}
}
But what if I want to search the file all over again and print foo2
and bar2 and whats between and how do I remove the printed lines from
the logfile?
Any help is appreciated, even if it is just a hint.
Thanks in advance!
Magnus