[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[debbugs-tracker] bug#24881: closed (make blindingly clear cut -f 2, 1 =
From: |
GNU bug Tracking System |
Subject: |
[debbugs-tracker] bug#24881: closed (make blindingly clear cut -f 2, 1 = cut -f 1, 2) |
Date: |
Sat, 05 Nov 2016 12:20:02 +0000 |
Your message dated Sat, 5 Nov 2016 12:19:11 +0000
with message-id <address@hidden>
and subject line Re: bug#24881: make blindingly clear cut -f 2,1 = cut -f 1,2
has caused the debbugs.gnu.org bug report #24881,
regarding make blindingly clear cut -f 2,1 = cut -f 1,2
to be marked as done.
(If you believe you have received this mail in error, please contact
address@hidden)
--
24881: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24881
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message ---
Subject: |
make blindingly clear cut -f 2,1 = cut -f 1,2 |
Date: |
Sat, 05 Nov 2016 19:31:32 +0800 |
$ info cut
‘-f FIELD-LIST’
‘--fields=FIELD-LIST’
Select for printing only the fields listed in FIELD-LIST. Fields
are separated by a TAB character by default. Also print any line
that contains no delimiter character, unless the ‘--only-delimited’
(‘-s’) option is specified.
Note ‘awk’ supports more sophisticated field processing, and by
default will use (and discard) runs of blank characters to separate
fields, and ignore leading and trailing blanks.
awk '{print $2}' # print the second field
awk '{print $NF-1}' # print the penultimate field
awk '{print $2,$1}' # reorder the first two fields
Mention here:
whereas cut -f 2,1 will just give you the same output as cut -f 1,2
Thanks.
In the unlikely event that ‘awk’ is unavailable, one can use the
‘join’ command, to process blank characters as ‘awk’ does above.
join -a1 -o 1.2 - /dev/null # print the second field
join -a1 -o 1.2,1.1 - /dev/null # reorder the first two fields
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#24881: make blindingly clear cut -f 2,1 = cut -f 1,2 |
Date: |
Sat, 5 Nov 2016 12:19:11 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 05/11/16 11:31, 積丹尼 Dan Jacobson wrote:
> $ info cut
>
> ‘-f FIELD-LIST’
> ‘--fields=FIELD-LIST’
> Select for printing only the fields listed in FIELD-LIST. Fields
> are separated by a TAB character by default. Also print any line
> that contains no delimiter character, unless the ‘--only-delimited’
> (‘-s’) option is specified.
>
> Note ‘awk’ supports more sophisticated field processing, and by
> default will use (and discard) runs of blank characters to separate
> fields, and ignore leading and trailing blanks.
> awk '{print $2}' # print the second field
> awk '{print $NF-1}' # print the penultimate field
> awk '{print $2,$1}' # reorder the first two fields
>
>
> Mention here:
> whereas cut -f 2,1 will just give you the same output as cut -f 1,2
> Thanks.
Pushed at
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.25-86-g5161eff
thanks,
Pádraig
--- End Message ---
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [debbugs-tracker] bug#24881: closed (make blindingly clear cut -f 2, 1 = cut -f 1, 2),
GNU bug Tracking System <=