GNU bug report logs - #6394
Is it possible to reorder fields with cut?

Previous Next

Package: coreutils;

Reported by: Peng Yu <pengyu.ut <at> gmail.com>

Date: Thu, 10 Jun 2010 16:59:02 UTC

Severity: normal

Tags: notabug

Merged with 9507, 13301

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Peng Yu <pengyu.ut <at> gmail.com>
To: 6394 <at> debbugs.gnu.org
Subject: bug#6394: Is it possible to reorder fields with cut?
Date: Thu, 10 Jun 2010 11:58:00 -0500
Hi,

I need to reorder the fields in a file. But the -f option can not be
used to reorder field 1 and field 2.

Basically, I want the original 1st field as the new 2nd field and the
original 2nd field the first. Is reordering fields possible with cut.

$ cat input.txt
a	b	c
e	f	g
$ cut -f 1,2 input.txt
a	b
e	f
$ cut -f 2,1 input.txt
a	b
e	f


-- 
Regards,
Peng




This bug report was last modified 12 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.