in reply to Re: elementary hash
in thread elementary hash, STDIN questions
perl -pi.bak -e 's/(^\s+$)?|blahblah|wahwah|yadayada//g' <filename>
If you run it twice, it'll squash blank lines. The regex could be more robust, but I hadn't seen any one-liner yet.
Update: I still don't understand tilly's followup, but let me explain what I mean a little further. My one-liner strips out the words mentioned above, but retains the line-ending newlines. tilly's dual-regex below fixes that. If you run mine twice, it'll get rid of the newlines (as the first part of the regex squashes whitespace). It has the (unlikely) side effect of getting rid of a string that, in the original file, would resemble 'blahyadayadablah'.
Not that you should be doing this with a one-liner.... :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 3: elementary hash
by tilly (Archbishop) on Sep 12, 2000 at 04:10 UTC |