bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] FIELDWIDTHS extension request


From: Ed Morton
Subject: [bug-gawk] FIELDWIDTHS extension request
Date: Thu, 18 May 2017 10:07:59 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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.



reply via email to

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