On Fri, 13 Jul 2012 15:59:26 -0700 (PDT)
Rich Shepard <[email protected]> wrote:

>    The text file has > 120k rows; each row has 8 columns. There are
> duplicate rows that I want to eliminate. My reading of the sort man
> page and various Web pages with examples tells me that the sort --key
> option is limited to a sequential starting field and ending field.
> What I need is to sort on fields 1, 2, and 4.
> 
>    If 'sort' won't do this, what tool will? I don't see how awk, sed,
> or grep can, yet a combination of these perhaps might.
> 

The uniq(1) command can help you here, I think.  Perhaps something
along the lines of

    sort --key=1,2,4 filename.txt | uniq

would do the job?

--Dale

--
People will accept your ideas much more readily if you tell them
that Benjamin Franklin said it first.
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to