Gilbert, I wrote an awk script to do this in the past. I need to search
for it now. Clue is to add 3 lines in the body of the awk. (line-1) use
if statement and set a flag to 1 and "skip 1", if pattern1 matches with
$0 and then (line-2) reset the flag to 0 and "skip 1", if the pattern2
matches with $0. And at the end (line-3) print $0, if the flag is tested
with 1. Here flag is an awk variable. Let me know if you still need it
and I can get it.

-Satya

-----Original Message-----
From: Rebhan, Gilbert [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 14, 2004 10:55 AM
To: ant_user (E-Mail)
Subject: yet another regex question


Hi,

is there a possibility to scan a txtfile with filterchain + regex for :

pattern1
.
.       <-- i want to grab only the content between the two patterns
.
.
pattern2
line1
line2
line3 (optional)

??

Problem = i may not use the tailfilter and skip=3, because the
lines after pattern1 are variable in size.

Gilbert

 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to