bug#46328: 28.0.50; csv-transpose replaces field delimiters in quoted fields with newlines

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#46328: 28.0.50; csv-transpose replaces field delimiters in quoted fields with newlines

Filipp Gunbin
csv-mode 1.14 from elpa.  Both csv-separators and csv-field-quotes have
default values.

Create a new csv file with this single line:

--8<---------------cut here---------------start------------->8---
description,"a line, with comma, and another comma"
--8<---------------cut here---------------end--------------->8---

C-c C-t transforms this to:

--8<---------------cut here---------------start------------->8---
description
"a line
 with comma
 and another comma"
--8<---------------cut here---------------end--------------->8---

The commas inside a (quoted) field were replaced by newlines, this looks
like a bug.

Thanks.

In GNU Emacs 28.0.50 (build 3, x86_64-apple-darwin20.2.0, NS appkit-2022.20 Version 11.1 (Build 20C69))
 of 2021-02-05 built on fgunbin.local
Repository revision: f00afb9bb8b5356690e2a785d14aa89995c96f50
Repository branch: master
System Description:  macOS 11.1



Reply | Threaded
Open this post in threaded view
|

bug#46328: 28.0.50; csv-transpose replaces field delimiters in quoted fields with newlines

Lars Ingebrigtsen
"Peder O. Klingenberg" <[hidden email]> writes:

> Caused by split-string not caring about char-syntax ?\".  Here's a
> patch.  If a line has quote chars, use csv-forward-field to fetch each
> field, ensuring consistency in what the mode considers a field.

Thanks; applied to the csv-mode GNU ELPA package now.  (That is, I hope
-- I'm not 100% sure how the new ELPA layout works after the recent
changes...)

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no