SLUG Mailing List Archives
Re: [SLUG] Tuesday afternoon shell command optimisation party!
- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] Tuesday afternoon shell command optimisation party!
- From: Jeff Waugh <jdub@xxxxxxxxxxxxxx>
- Date: Tue, 18 Dec 2007 16:32:03 +1100
- Jabber-id: jdub@xxxxxxxxx
- User-agent: Mutt/1.5.17 (2007-11-01)
<quote who="Martin Barry">
> $quoted_author = "Jeff Waugh" ;
> > Here's a starting point. What's a more optimal way to perform this task?
> > :-)
> the first question was "what is the task trying to achieve?" :)
That's part of the challenge.
> > sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
> you appear to be counting the number of fields in a csv file but unless
> there is a trailing comma each line worth of data will be 'off by 1'
Ah, an interesting thought, but no, it's more of a blunt instrument than
linux.conf.au 2008: Melbourne, Australia http://lca2008.linux.org.au/
"In addition to these ample facilities, there exists a powerful
configuration tool called gcc." - Elliot Hughes, author of lwm