The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: arnold@skeeve.com
To: tuhs@tuhs.org, richard@inf.ed.ac.uk
Subject: Re: [TUHS] Awk for CSV files
Date: Sun, 13 Oct 2019 08:57:31 -0600	[thread overview]
Message-ID: <201910131457.x9DEvVGa026545@freefriends.org> (raw)
In-Reply-To: <20191013135344.E0F4C292AD4E@macaroni.inf.ed.ac.uk>

Awk and csv isn't new. Googling 'awk csv' gets you a bunch of results.

There is also the 'csv' dynamically loadable extension for gawk to
be found in the gawkextlib project.  Contact me off-list if you want
more details.

Thanks,

Arnold

Richard Tobin <richard@inf.ed.ac.uk> wrote:

> I was reminded of this by Larry's comment:
>
> > I miss Brian on this list.  I've interacted with him over the years, the
> > one I remember the most was I was trying to do an awk like interface to a
> > key/value "database".
>
> Recently I've had to deal with a lot of data in CSV
> (comma-separated-value) format.  Awk is *almost* prefect for this, but
> of course doesn't handle the quoting of fields that contain commas.
> One can usually work around it by finding a character that doesn't
> occur in the data and converting the CSV file to use that as the
> separator, but it's not ideal.
>
> Awk's input could easily be modified to handle CSV files, but output
> would be a bit more difficult, because you don't specify field
> boundaries explicitly on output.  One possibility would be a printf()
> format specifier that takes a field and quotes it appropriately.
>
> -- Richard
>
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.

  reply	other threads:[~2019-10-13 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-13 13:53 Richard Tobin
2019-10-13 14:57 ` arnold [this message]
2019-10-13 18:46 ` William Corcoran
2019-10-13 19:36   ` Henry Bent
2019-10-13 22:30     ` William Corcoran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201910131457.x9DEvVGa026545@freefriends.org \
    --to=arnold@skeeve.com \
    --cc=richard@inf.ed.ac.uk \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).