[CentOS] Cut command behaviour - bug or feature
Stephen Harris
lists at spuddy.orgTue Aug 28 21:52:26 UTC 2012
- Previous message: [CentOS] Cut command behaviour - bug or feature
- Next message: [CentOS] CentOS-announce Digest, Vol 90, Issue 17
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Aug 29, 2012 at 01:29:05AM +0530, Rajagopal Swaminathan wrote:
> a1,b1,c1
> a2,b2,c2
> cut -d, -f2,3,1 <file>
Will not work. The "-f" flag specifies what columns; not the order.
Everyone makes that mistake once :-)
> In that case how do I go about swapping two columns? I do not think a
> gazzillion byte gui is required.
Use "awk"
awk -F, '{print $2 "," $3 "," $1}'
--
rgds
Stephen
- Previous message: [CentOS] Cut command behaviour - bug or feature
- Next message: [CentOS] CentOS-announce Digest, Vol 90, Issue 17
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list