Re: How to exchange two columns in a table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim Chase, le Mon 08 Jan 2007 12:42:11 -0600, a écrit :
> >You can use cut for this:
> >
> >cut -d "	" -f 1-3,5,4,6-8
> >
> >(the character between the two " is a tab, which you can type by
> >pressing ^V then the tab.  Here columns 3 and 4 are exchanged.
> 
> It would be really nice if "cut" did this.  However, cut doesn't 
> emit the fields in the requested order, but rather (from the man 
> page) "The  order of ... fields in the output will be identical 
> to those in the input".

Gasssp.  I thought it was the case.  Thanks for the info!

> Additionally, if you want to be lazy, the delimiter for "cut" 
> defaults to a tab, so you don't have to specify it unless you use 
> a different delimiter such as a colon.

I can never remember this, so always specify it :)

Samuel

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list

[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]