[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ptx outputs empty file
From: |
Paul Jarc |
Subject: |
Re: ptx outputs empty file |
Date: |
Mon, 04 Feb 2002 11:56:46 -0500 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/20.7 (i386-redhat-linux-gnu) |
address@hidden (jmoss) wrote:
> Input is about 1000 lines of three-column text with tabs as column delimiter.
> Sorting is to be performed on the middle column.
You can use sed to switch the first two columns, sort, and sed again
to switch them back (if necessary).
sed 's/^\([^ ]* \)\([^ ]* \)/\2\1/'
> The UNIX sort commands works for sorting only on the first word
GNU sort also has:
-k, --key=POS1[,POS2]
start a key at POS1, end it at POS 2 (origin 1)
paul