Groups | Search | Server Info | Login | Register


Groups > comp.lang.awk > #9825

Re: [gawk] Handling variants of CSV input data formats

From Ed Morton <mortonspam@gmail.com>
Newsgroups comp.lang.awk
Subject Re: [gawk] Handling variants of CSV input data formats
Date 2024-08-26 06:26 -0500
Organization A noiseless patient Spider
Message-ID <vahop1$2eavu$1@dont-email.me> (permalink)
References <vaeh9m$1pfge$1@dont-email.me>

Show all headers | View raw


On 8/25/2024 1:00 AM, Janis Papanagnou wrote:
> Myself I'm usually not using CSV format(s), but recently I advertised
> GNU Awk (given that newer versions support CSV data processing) to a
> friend seeking CSV solutions.
> 
> I was quite astonished when I stumbled across a StackOverflow article
> about CSV processing with contemporary versions of GNU Awk and read
> that you are restricted to comma as separator and double quotes to
> enclose strings. The workarounds provided at SO were extremely clumsy.
> 
> Given that using ',', ';', '|' (or other delimiters) and also various
> types of quotes are just a lexical (no functional) difference I wonder
> whether it would be sensible to be able to define them, say, through
> setting a PROCINFO element?
> 
> Janis
> 
> https://stackoverflow.com/questions/45420535/whats-the-most-robust-way-to-efficiently-parse-csv-using-awk
> 

FYI gawk just inherited those behaviors (plus mandatory stripping of the 
quotes from quoted fields, see 
https://lists.gnu.org/archive/html/bug-gawk/2023-11/msg00018.html) from 
Kernighans awk.

	Ed.

Back to comp.lang.awk | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

[gawk] Handling variants of CSV input data formats Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-08-25 08:00 +0200
  Re: [gawk] Handling variants of CSV input data formats Ed Morton <mortonspam@gmail.com> - 2024-08-26 06:26 -0500
    Re: [gawk] Handling variants of CSV input data formats Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-08-26 14:54 +0200
      Re: [gawk] Handling variants of CSV input data formats Manuel Collado <mcollado2011@gmail.com> - 2024-08-26 19:01 +0200
        Re: [gawk] Handling variants of CSV input data formats Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-08-27 02:31 +0200
          Re: [gawk] Handling variants of CSV input data formats Manuel Collado <mcollado2011@gmail.com> - 2024-08-27 12:20 +0200
            Re: [gawk] Handling variants of CSV input data formats Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-08-27 18:19 +0200
      Re: [gawk] Handling variants of CSV input data formats Ed Morton <mortonspam@gmail.com> - 2024-08-26 19:49 -0500
        Re: [gawk] Handling variants of CSV input data formats Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-08-27 03:39 +0200
          Re: [gawk] Handling variants of CSV input data formats Ed Morton <mortonspam@gmail.com> - 2024-08-27 06:45 -0500
            Re: [gawk] Handling variants of CSV input data formats Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-08-27 18:23 +0200

csiph-web