bug-coreutils
[Top][All Lists]
Advanced

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

Re: Basic usage question involving "cut"


From: Pádraig Brady
Subject: Re: Basic usage question involving "cut"
Date: Tue, 01 Aug 2006 10:54:56 +0100
User-agent: Mozilla Thunderbird 1.0.8 (X11/20060502)

Linda Walsh wrote:
> Don't know if this is the appropriate place for this, but if it
> isn't possible, I could "suggest" that it might be considered a
> bug or at least a "design deficiency". :-)
> 
> Something that's always bothered me about "cut".  It seems it has
> at least two ways to define fields, that I'm aware of: defining
> by character position and defining by a delimiter.
> 
> What I don't know how to do is how to select a "whitespace"
> delimited field.  It's one of the more common field delimiters I
> run into.  The easiest, but rather inefficient methods is to
> pipe the input into a shell-based "while read field1, field2..."
> loop, but it sure would make sense if there was an option
> to "cut" to handle white-space delimited fields.
> 
> Is there an option to "cut" that I don't know about, or am I
> looking in the wrong place for this type of functionality,
> or is this a feature "deficit", in "cut", that needs remedying?

That is a deficiency IMHO. For all the coreutils
there should be a way to specify which fields,
delimters defaulting to runs of whitespace, but
one can specify delimiters also.
sort supports this, and a lot of other utils
will probably get this functionality at some stage.

For a work around, see the comments at the top of:
http://www.pixelbeat.org/scripts/add

Pádraig.




reply via email to

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