zsh-users
 help / color / mirror / code / Atom feed
From: Dominik Vogt <dominik.vogt@gmx.de>
To: Zsh Users <zsh-users@zsh.org>
Subject: Parsing CVS files
Date: Sat, 2 Feb 2019 19:59:11 +0100	[thread overview]
Message-ID: <20190202185911.vsmvvsp5df3yaa3z@gmx.de> (raw)

Hi folks,

I'm looking for an easy way to split the lines of a .csv file into
the fields of an array variable.  There's a script that does that
somewhore on the net.  But that script parses lines character by
character and just manages to parse about 100 (long) lines per
second.

Fields in a .csv file are separated by commas, *but* commas
between a pair of quotes do not split.  Or phrased differently:
Commas that have an even number of double quotes left of them do
split, but commas with an uneven number left of then don't split.

Any ideas for a quick implementation?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt

             reply	other threads:[~2019-02-02 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02 18:59 Dominik Vogt [this message]
2019-02-02 20:14 ` Peter Stephenson
2019-02-03  4:19   ` Sebastian Gniazdowski
2019-02-05 21:30     ` Dominik Vogt

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=20190202185911.vsmvvsp5df3yaa3z@gmx.de \
    --to=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).