Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Tuesday afternoon shell command optimisation party!


This one time, at band camp, Jeff Waugh wrote:
>Hi all,
>
>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!

You want to count the total number of characters in a file, not including
newlines, that are on lines that don't start with a comma.

Does it have to be in shell? :-)