[Top][All Lists]

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

Re: [bug-gawk] Feature request -- field indices for split

From: Aharon Robbins
Subject: Re: [bug-gawk] Feature request -- field indices for split
Date: Fri, 27 Jan 2012 11:46:27 +0200
User-agent: Heirloom mailx 12.4 7/29/08

Hello.  Thank you for your mail.

> To: address@hidden
> From: forkandwait <address@hidden>
> Date: Mon, 23 Jan 2012 20:00:23 +0000 (UTC)
> Subject: [bug-gawk] Feature request -- field indices for split
> Hi excellent folks --
> Could I suggest an extension to the fixed-width approach to splitting
> fields?
> It would be great to specify the column number which defines the data
> to be split. For example, FIELDINDICES="1 10 12" would fill $1, $2,
> $3 with everything from columns 1 thru 9, then columns 10 thru 11,
> then from column 12 to the end of the line (respectively).
> I know this is redundant with FIELDWIDTHS, but I think it is closer to
> how many analysts think about data in a fixed width data file.  It also
> matches more closely how other ETL languages do it.

(I don't know what "ETL" means here.)

As you point out, your requested feature is redundant with FIELDWIDTHS.
I don't think this feature is used much as it is, and I am loathe to add
yet another feature that almost noone will ever use.  Gawk already
has too many of those, that seemed like good ideas at the time but
in retrospect were not.

> I will probably work up a GAWK function to take indices and generate a
> FIELDWITHS string, but that seems like a bit of a hack.

I think this is the right thing to do.

> Thanks for the time and consideration!

You're welcome.

Thanks for the input,


reply via email to

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