Re: *really* shortest match in awk - possible?



Tomasz Chmielewski schrieb:
Yes, everything is possible in awk, but not for mere mortals, right?

I have a mbox file (see below for an example) with advertisements attached to the end of every message. I would like to remove these ads.
Ads are placed between -------- and _________ characters.

I tried using something like:

awk '/^----/,/^____/{next}{print}'

but it eats up a bit too much, and one could argue if it's really the shortest match.

Thanks a lot for all answers in this thread! ;)


--
Tomasz Chmielewski
http://wpkg.org
.



Relevant Pages