[OTW] Grep vs SED

David Cary Hart Fedora at TQMcube.com
Wed May 10 15:26:08 UTC 2006


On Wed, 10 May 2006 11:17:20 -0400, David Cary Hart
<Fedora at TQMcube.com> opined:
> On Tue, 9 May 2006 14:10:57 -0400 (EDT), "Robert P. J. Day"
> <rpjday at mindspring.com> opined:
> > On Tue, 9 May 2006, David Cary Hart wrote:
> > 
> > > (Off the Wall Question) I have been asked:
> > >
> > > Given a very large file.txt and a desire to remove a matching
> > > line:
> > >
> > > 	$ grep -v matching_line file.txt > file.txt.new
> > >
> > > or;
> > >
> > > 	$ sed '/matching_line _RegEx/d'  file.txt > file.txt.new
> > >
> > > Which method is more efficient or is it a tossup?
> > 
> > why not use "time" to find out?
> > 
> Simple. I did not think of doing so. Thanks - I think. -;)
> 
And the answer is grep -v to a larger extent than I expected.

-- 
Our DNSRBL - Eliminate Spam: http://www.TQMcube.com
Multi-RBL Check: http://www.TQMcube.com/rblcheck.php
The Dirty Dozen Spammiest Ranges: http://tqmcube.com/dirty12.php

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20060510/70721f2e/attachment-0002.bin 


More information about the users mailing list