[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: formerly: emacs guy needs vi hack
On Mon, Jul 09, 2001 at 11:53:54AM -0700, Robert Threet wrote:
> Thanks for all of the good info. Okay, how about
> this: I ran this cron job on July 4th, and I shouldn't
> have, so I have a 500 line file with a dozen or so
> redundant entries. Anybody know a good way to clean
> them out? I sorted the file so the pairs show up but
> they're scattered. No biggee. I think my script will
> pass on the redundant ones without too much trouble.
cat file | perl -nle'print unless(/regexp/);' > newfile
Substitute your repeating line regular expression for "regexp" there.
At least, that's how *I* would do it... :)
--Danny
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.