[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uniq --accumulate
From: |
Assaf Gordon |
Subject: |
Re: uniq --accumulate |
Date: |
Tue, 07 Feb 2012 11:21:07 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 |
Pádraig Brady wrote, On 02/07/2012 11:00 AM:
> On 02/07/2012 03:56 PM, Peng Yu wrote:
>>
>> Suppose that I have a table of the following, where the last column is
>> a number. I'd like to accumulate the number of rows that are the same
>> for all the remaining columns.
>>
>
> Thanks for the suggestion,
> but this is too specialized for coreutils I think.
Slightly off-topic for coreutils,
but a package called "BEDTools" ( http://code.google.com/p/bedtools/ ) provides
a program called "groupBy", which does exactly that, and more.
Akin to SQL's "group by" command, the program can group a text file by a
specified column, and perform operations (count,sum,mean,median,etc.) on
another column.
-gordon