[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG REPORT
From: |
Eric Blake |
Subject: |
Re: BUG REPORT |
Date: |
Mon, 05 Mar 2007 06:12:11 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.666 |
-----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:address@hidden: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:address@hidden
$
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 address@hidden
-----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 REPORT, Axel Colunga, 2007/03/03
- Re: BUG REPORT, Eric Blake, 2007/03/03
- Message not available
- Re: BUG REPORT,
Eric Blake <=