[Omaha.pm] perl instead of cut -f 2,3,1

Jay Hannah jay.hannah at iinteractive.com
Tue Apr 17 10:58:36 PDT 2012


Hi David,

As you discovered, 

   cut -f 2,3,1 inputfile.txt

Actually gives you columns 1,2,3. cut ignores resorting requests. (boo!)

Perl field numbering starts at zero instead of one. This should give you want you wanted:

   perl -anE 'say join "\t", @F[1,2,0]' inputfile.txt

Cheers,

Jay Hannah
Project Lead / Programmer
http://www.iinteractive.com
Email: jay.hannah at iinteractive.com
AOL IM: deafferret
Mobile: 1.402.598.7782
Fax: 1.402.691.9496







More information about the Omaha-pm mailing list