[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cut feature request: treat multiple consecutive delimiters as one
From: |
Pádraig Brady |
Subject: |
Re: cut feature request: treat multiple consecutive delimiters as one |
Date: |
Tue, 26 Apr 2011 21:30:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 26/04/11 20:44, Brandon Wood wrote:
> When dealing with stdout or delimited files that have multiple
> consecutive delimiters, I think that allowing cut to treat these as a
> single delimiter may be advantageous.
>
> When considering a trivial example,
> $ wc -l *.dat | grep data
> 1107 data_01.dat
> 180 data_02.dat
> 317 data_03.dat
> 295 data_04.dat
> 10 data_05.dat
> $ !! | cut --mult-delim -d " " -f 1,2
> 1107 data_01.dat
> 180 data_02.dat
> 317 data_03.dat
> 295 data_04.dat
> 10 data_05.dat
> Any thoughts? My apologies if this is a previously requested feature,
> though I did not find it in the archives.
Yes, we're maybe leaning towards adding cut --blank-separated
http://lists.gnu.org/archive/html/bug-coreutils/2010-11/msg00203.html
For the moment, we've documented `awk` and `join` alternatives:
http://www.gnu.org/software/coreutils/manual/coreutils.html#cut-invocation
cheers,
Pádraig.