[Nottingham] Stripping lines out of a text file

Martin Garton martin at stupids.org
Thu Mar 13 16:20:12 GMT 2008

On Thu, 2008-03-13 at 16:17 +0000, Martin Garton wrote:
> On Thu, 2008-03-13 at 16:04 +0000, JJSH wrote:
> > "Size", "EDM", "Material", "Date", "Client".
> > 
> > Can anyone think of a way I can strip out all of the lines that don't 
> > begin with one of the above, other than tediously going through it 
> > manually (some of the files are huge)? The remaining data needs to be 
> > kept in sequence.
> Something like:
> egrep "^((Size)|(EDM)|(Material)|(Date)|(Client))" file.txt

or even:

egrep "^(Size|EDM|Material|Date|Client)" file.txt

which is what I meant to say.  But I see that Cam beat me to it anyway..


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/nottingham/attachments/20080313/6fc2f527/attachment.bin

More information about the Nottingham mailing list