[Tutor] manipulating a file

Shitiz Bansal shitizb at yahoo.com
Tue Feb 8 01:30:25 CET 2005


I aplogise for a typo...

Please read the command as:
     cat log|grep -v -E [[:alnum]]'{2096,}'>> log.bak

note the missing comma in the previous command.
--- Shitiz Bansal <shitizb at yahoo.com> wrote:

> 
> How about 
>    cat log|grep -v -E [[:alnum]]'{2096}'>> log.bak
> 
> The issue is - will unix shell command be any more
> efficient than a python script??
> 
> Also i used append because i gathered that the user
> will not want to erase the previous logs. He is free
> to use a single > if he does.
> 
> 
> --- Alan Gauld <alan.gauld at freenet.co.uk> wrote:
> 
> > > About the efficiency, why do u need python at
> > all...
> > > How abt a simple shell command....
> > >        cat httpd-access.log>>log.bak
> > > 
> > 
> > Because that would be a copy, well actually an
> > append...
> > 
> > cp httpd-access.log log.bak
> > 
> > would be better!
> > 
> > But the OP wanted to strip out long lines in
> transit
> > not just copy...
> > 
> > Alan G.
> > 
> > 
> > 
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Find what you need with new enhanced
> search.
> http://info.mail.yahoo.com/mail_250
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Tutor mailing list