[Tutor] manipulating a file

Shitiz Bansal shitizb at yahoo.com
Mon Feb 7 22:01:29 CET 2005


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


More information about the Tutor mailing list