Results 1 to 1 of 1
Ok, in a file like this I need to find all the occurrences of where the 'marker' pattern does not come after or before another 'marker' pattern:
marker 1
marker ...
- 02-09-2010 #1Just Joined!
- Join Date
- Dec 2006
- Posts
- 5
sed multiline problem
Ok, in a file like this I need to find all the occurrences of where the 'marker' pattern does not come after or before another 'marker' pattern:
marker 1
marker 2
marker 3
marker 4
marker 5
marker 6
So the multiline expression should only match on 'marker 3'
sed -n -e '/^.*marker.*$/I!{N;/^.*marker.*$/I{N;/^.*marker.*$/I!{p;};};};' testfile
but the script will not print the match.
GNU sed version 4.1.5
????


Reply With Quote
