bug-gawk
[Top][All Lists]
Advanced

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

Re: CSV extension status


From: Manuel Collado
Subject: Re: CSV extension status
Date: Mon, 17 May 2021 15:44:10 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

El 16/05/2021 a las 22:21, Ed Morton escribió:
The gawkextlib CSV extension has been listed on
http://gawkextlib.sourceforge.net/ for a while now (a year or more?) but
noted as "(not yet released)". Is there anything specific holding up its
release and/or a planned date when it will be released?

Thanks for your interest.

The gawk-csv extension pushes the gawk API for input parsers to its limits. And uncover some nasty limitations. An input parser can deliver a record composed of fields, but there is no way to control further reparsing of the record after assigning new values to $0..$NF. To do so it it necessary to have a companion pure (g)awk library that temporarily overrides FS, OFS, etc. In addition the generation of CSV output is easier to code in AWK than in C.

The fact is that the combination of FPAT and BEGINFILE/ENDFILE has enough power to implement an effective CSV processing with just a pure gawk library. Please look at the CSVMODE library available at:

    http://mcollado.z15.es/xgawk/

This library extends the functionality of the gawk-csv extension with the ability to operate with either CSV fragments or clean text field values.

The only advantage of using the API for parsing CSV fields is the ability to provide meaningful error messages and recovering of malformed CSV data.

In order to made a decision about maintenance of the gawk-csv extension a feedback from potential users will be very welcome. For instance:

- Should it be desirable to also host pure gawk modules in the gawkextib site?

- In order to unify the user interface of gawk-csv and the CSVMODE library, which control variable value is more natural to select clean text field values?
   CSVMODE = 1 as in gawk-csv, or
   CSVMODE = -1 as in the CSVMODE library ?

Any opinion or suggestions about this or similar extensions will be very appreciated.

Regards.

--
Manuel Collado - http://mcollado.z15.es



reply via email to

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