coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New feature for 'wc': Filter lines by character count


From: SAeeD
Subject: New feature for 'wc': Filter lines by character count
Date: Thu, 3 Apr 2014 18:59:07 +0430

Hello,

I was parsing a log file some days ago, and it had about 1,600,000 lines. All lines in that log file were supposed to have a fix length of say, 140 characters. Because of some noises on RS232 cable, some lines had fewer or much characters than 140.
I was thinking of a program that let me knew how many lines have more/less characters than specified (here 140). I wrote a simple program for my purpose but I thought it is better to integrate this feature in a well-know frequently used tool like 'wc'.
So, the usage would be something like:
$ cat log.txt | wc --more-chars-than 140
9 (for instance)
$ cat log.txt | wc --less-chars-than 140
11 (for instance)

Filtering lines by number of word can also be added.

I read the rejected features for coreutils at http://www.gnu.org/software/coreutils/rejected_requests.html and there was no feature request alike this one. I also searched the mailing list archive and did not find any discussion similiar.

What's your opinion about this feature?
I'm also volunteer and interested to implement it, if accepted.

Thanks,
SAeeD Ehteshamifar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]