-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Please keep replies on the list, so that you will get a faster response, and so that others with a similar problem can search the list archives for your solution.
According to Axel Colunga on 3/3/2007 3:56 PM: > for example if i have a file with 5 cols and separated by ":" like > 45613:john Smith:1st av #2:[EMAIL PROTECTED]:TX and i want to subtract 3rd > 2nd and 4th fields in this order the program will be halted, in a few > words if i want to subtract some fields but these fields when i select > the order in other order that isnĀ“t consecutive the program will crash > > > example: > > take the 1st example and suposing i have a file with some registers like > the example and i want to creat a new file using cut and trying to > filtering and giving format with cut: > > cut -d ':' -f 3,2,4 file > newfile > > > the program never finish the work... coz the program only accept options > in ascendent mode like 1,2,3,4.... It worked for me as documented: $ cut -d ':' -f 3,2,4 file > newfile $ cat newfile john Smith:1st av #2:[EMAIL PROTECTED] $ According to POSIX: "The elements in list can be repeated, can overlap, and can be specified in any order, but the bytes, characters, or fields selected shall be written in the order of the input data." If you want to rearrange fields, then you must use something other than cut. awk will do just fine. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF7Bcr84KuGfSFAYARAjheAJ41wsj0H/LANexFRE5Yg3UDuO1XuwCgt15M DTiXDZeqiEbuO8twtwRUOJk= =VIkU -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils