bug-coreutils
[Top][All Lists]
Advanced

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

Re: I would like to add a feature to the cut command, I think


From: Bob Proulx
Subject: Re: I would like to add a feature to the cut command, I think
Date: Thu, 1 Apr 2004 23:16:38 -0700
User-agent: Mutt/1.3.28i

Jeff Silverman wrote:
> I am trying to parse whitespace delimited files, and it seems 
> intuitively obvious to me that I ought to be able to do it with the cut 
> command.

The 'cut' command is really a very small and simple command.  It was
designed to split apart TAB separated tables.  It is really not meant
to handle general whitespace delimited files.  The better tool there
is awk which is a portable and standard tool.  I suggest you use awk.

Example, printing the second field of a file:

  awk '{print$2}'

> Of course, I can do this with a one liner in perl, but that's not the point.

Actually that is the point.  There are many other tools that already
do this so there should not be a need to create yet another.  Perl is
prevalent and pervasive but hardly standard in that there are so many
versions.  I prefer awk to this because awk is standard.  A script
using awk will run anywhere.

Bob




reply via email to

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