bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] FIELDWIDTHS extension request


From: Manuel Collado
Subject: Re: [bug-gawk] FIELDWIDTHS extension request
Date: Thu, 18 May 2017 19:37:45 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

A simpler approach could be to keep the current FIELDWITHS syntax spec, and just change its semantics so if there is extra input content put it in a (N+1) extra field.

HTH.

Regards.

El 18/05/2017 a las 17:07, Ed Morton escribió:
Could we get an extension for FIELDWIDTHS such that a "*" (or some other
indicator) means "everything else"? It's very common to have to deal
with files like:

     foo  bar    stuff
     bill johnny other stuff of some different length

where it's easy to see the length of the first 2 fields but the length
of the final field can't be determined based on any sample so we end up
writing code like:

     FIELDWIDTHS = "5 7 9999"

and pick some arbitrary number that we hope will be big enough to hold
whatever appears in that 3rd field. It would be clearer and more robust
if we could instead write:

     FIELDWIDTHS = "5 7 *"

or similar.

We've been having a discussion about the applicability of this at
https://groups.google.com/forum/#!topic/comp.lang.awk/uip6-Ll9Lj0 in
case some more background is useful.

Regards,

     Ed.




--
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado




reply via email to

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