- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] Tuesday afternoon shell command optimisation party!
- From: Jamie Wilkinson <jaq@xxxxxxxxxxxxxx>
- Date: Tue, 18 Dec 2007 23:55:54 +1100
- User-agent: Mutt/1.5.17 (2007-11-01)
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? :-)