On Tue, 2007-12-18 at 16:09 +1100, Jeff Waugh wrote:
> Here's a starting point. What's a more optimal way to perform this task? :-)
> 
>   sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
> 
> Tuesday afternoon shell optimisation party!

How do you want it optimised?

grep -o is the most readable. But the fastest I've found so far is

cat input.txt | tr -d '\n' | tr ',' '\n' | wc -l

-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to