bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: say that cut can't handle more than one field demarcator


From: Pádraig Brady
Subject: Re: say that cut can't handle more than one field demarcator
Date: Mon, 08 Mar 2010 10:19:07 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 05/03/10 01:31, Pádraig Brady wrote:
On 04/03/10 20:05, address@hidden wrote:
On (info "(coreutils) cut invocation") please add:
cut has no way to specify a group of blanks as a field demarcator.
If you want that, use perl -a. Also use perl's split if you want
regexp demarcators, etc.
If that is indeed the case.

Actually using tr from coreutils you can do:

tr -s '[:blank:]' '\t' | cut -f5

In fact I thought I had already added that to
the info docs. I had intended adding it at least,
but obviously I misremembered checking it in.
I'll do that very soon.

I'll push this to coreutils.texi (cut invocation) soon:

`-f FIELD-LIST'
`--fields=FIELD-LIST'
     ..............................................  Note `cut' does
     not support specifying runs of whitespace as a delimiter, so to
     achieve that common functionality one can pre-process with `tr'
     like:
          tr -s '[:blank:]' '\t' | cut -f...

cheers,
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]