-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 15 March 2003 10:35 pm, Youichi Mano wrote: > dear Michael Fratoni, > > My example does not seem to be good. > The first column is not every single digit, > and the delimiter is usually not space but TAB. > > Therefore, better example is the following. > If the second column uniq is operated > ----------- > AAAA 10 387 > BB 10 6 > CCCCC 77777 5 > ----------- > > the result should be > ----------- > AAAA 10 387 > CCCCC 77777 5 > ----------- > (upper line is adopted) > > I can sort the specified column. > sort -k 2 1.txt > > But I cannot uniq the specified column because > GNU uniq does not support that feature. > -w is for fixed length. -f is not enough to realize this.
I knew it looked too easy. ;) However, can't you use sort's uniq flag (-u) with -n for a numeric sort? $ sort -k 2 -nu test.txt AAAA 10 387 CCCCC 77777 5 - -- - -Michael pgp key: http://www.tuxfan.homeip.net:8080/gpgkey.txt Red Hat Linux 7.{2,3}|8.0 in 8M of RAM: http://www.rule-project.org/ - -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+c/b5n/07WoAb/SsRAg7nAJ90E8DkaZX+YHESo8dh/ZMNG7Ka5wCghUKS 6yLDLZxeZGQMGyzlwvpxhaE= =0gQD -----END PGP SIGNATURE----- -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list