[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uniq feature request: check-fields option
From: |
Steve Ward |
Subject: |
Re: uniq feature request: check-fields option |
Date: |
Thu, 7 May 2009 06:41:03 -0400 |
On Mon, May 4, 2009 at 01:58, Steve Ward <address@hidden> wrote:
> For the uniq program, these options exist:
>
> --skip-chars=N
> avoid comparing the first N characters
>
> --skip-fields=N
> avoid comparing the first N fields
>
> --check-chars=N
> compare no more than N characters in lines
>
>
> It would be nice to have:
>
> --check-fields=N
> compare no more than N fields in lines
>
>
>
> Steve
>
Here is my use case. I have a sorted file with lines like this:
<unsigned int><tab><string>
I want uniq to print only duplicate lines by comparing the first field, not
the rest of the line.
The integer is not padded, so the first field is never the same number of
characters. (Otherwise I'd use the check-chars option.) The string field
needs to remain intact.
Steve