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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Filipp Gunbin <fgunbin@HIDDEN>; Keywords: patch fixed; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 28.1, send any further explanations to 46328 <at> debbugs.gnu.org and Filipp Gunbin <fgunbin@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 46328 <at> debbugs.gnu.org:


Received: (at 46328) by debbugs.gnu.org; 23 Feb 2021 15:51:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 23 10:51:42 2021
Received: from localhost ([127.0.0.1]:60233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lEZyP-00037H-Rn
	for submit <at> debbugs.gnu.org; Tue, 23 Feb 2021 10:51:42 -0500
Received: from quimby.gnus.org ([95.216.78.240]:60504)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lEZyN-000371-Ed
 for 46328 <at> debbugs.gnu.org; Tue, 23 Feb 2021 10:51:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=nCjhdjE05QdtsnXP3ML7UROwrdjkf19HKMqqc9+T+jY=; b=CUnk3lUTBPa/anP61LbvrXf2tq
 5saZLDIwuNVBMsZw9YXcEq1OkGdNPllQt2HTwfUb1+G9qJ1YTJYg+d2fWgQCgiQg2BWh1sOxzwXzJ
 dkmlpqTeny+6jqoZbs8DBRiNsBpaz7tG1bMjdiQvvoCdmppQtzEtL6WhXZxpnE5pUAHA=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lEZyC-0001Tc-Q2; Tue, 23 Feb 2021 16:51:33 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: "Peder O. Klingenberg" <peder@HIDDEN>
Subject: Re: bug#46328: 28.0.50; csv-transpose replaces field delimiters in
 quoted fields with newlines
References: <m2wnvmegzg.fsf@HIDDEN> <86mtvv3cpc.fsf@HIDDEN>
X-Now-Playing: Jungle Brothers's _Straight Out The Jungle (1)_: "Graggin and
 Boastin"
Date: Tue, 23 Feb 2021 16:51:27 +0100
In-Reply-To: <86mtvv3cpc.fsf@HIDDEN> (Peder O. Klingenberg's message
 of "Tue, 23 Feb 2021 00:27:43 +0100")
Message-ID: <87y2febx4w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: "Peder O. Klingenberg" <peder@HIDDEN> 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 f [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 46328
Cc: 46328 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"Peder O. Klingenberg" <peder@HIDDEN> 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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46328; Package emacs. Full text available.
Added tag(s) patch. Request was from "Peder O. Klingenberg" <peder@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Feb 2021 23:27:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 22 18:27:56 2021
Received: from localhost ([127.0.0.1]:57905 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lEKcO-0001jG-2D
	for submit <at> debbugs.gnu.org; Mon, 22 Feb 2021 18:27:56 -0500
Received: from lists.gnu.org ([209.51.188.17]:48822)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <peder@HIDDEN>) id 1lEKcM-0001j9-4c
 for submit <at> debbugs.gnu.org; Mon, 22 Feb 2021 18:27:54 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:53762)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <peder@HIDDEN>)
 id 1lEKcL-0002Fn-Vm
 for bug-gnu-emacs@HIDDEN; Mon, 22 Feb 2021 18:27:54 -0500
Received: from castor.klingenberg.no ([176.125.234.34]:38894)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <peder@HIDDEN>)
 id 1lEKcJ-0001l8-8E
 for bug-gnu-emacs@HIDDEN; Mon, 22 Feb 2021 18:27:53 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=klingenberg.no; s=20200407; h=Content-Type:MIME-Version:Message-ID:
 In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Y3nYPkq3AkwAzDEhgFXx5gFuQtfZMbDBIUOLqClTzto=; b=K7Lo06DFr+1ePMtJkdoMpccOh
 16eT7ET+Lbwzsk2aD9G1DB/zJ/dsceeHUF3FBqjdMvdVm4iUotIIV+wT+PQsrVWumJHwrTnVtnKz3
 qqYYRZhEV7/ibMENjenBUgYyHzPp7e5LB8QjOLYSo3rnwdc4nJJvC/fGAy5RtYiCbRk6Ue06r41Xu
 XCJRIgUp1a131HCeZwJKMVYm+7SImrYGlWEK/mGltLpsH6i6SBRDzzTzpaSiCRKVzk3qwAMYhu4/H
 WMEplgZ20Qu0KuVca/uROd0WgAXa8BP7psEvisGL+Ev901PIMOBdvuwOQcdQTB/eDoSFSQDnz4uut
 xuzLxlfwg==;
Received: from ip-239-146-106-77.eidsiva.net ([77.106.146.239] helo=PedersHP)
 by castor.klingenberg.no with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <peder@HIDDEN>) id 1lEKcE-00086V-6T
 for bug-gnu-emacs@HIDDEN; Tue, 23 Feb 2021 00:27:46 +0100
From: "Peder O. Klingenberg" <peder@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#46328: 28.0.50; csv-transpose replaces field delimiters in
 quoted fields with newlines
References: <m2wnvmegzg.fsf@HIDDEN>
Date: Tue, 23 Feb 2021 00:27:43 +0100
In-Reply-To: <m2wnvmegzg.fsf@HIDDEN> (Filipp Gunbin's message of "Fri, 05
 Feb 2021 17:17:39 +0300")
Message-ID: <86mtvv3cpc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=176.125.234.34; envelope-from=peder@HIDDEN;
 helo=castor.klingenberg.no
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

On Fri, 2021-02-05 17:17:39 +0300, Filipp Gunbin wrote:

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

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.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Fix-transposing-csv-files-with-quoted-fields.patch

From d6b51e2f07d585106ce6ccfe484f12a9ed3fe9dc Mon Sep 17 00:00:00 2001
From: "Peder O. Klingenberg" <peder@HIDDEN>
Date: Tue, 23 Feb 2021 00:14:35 +0100
Subject: [PATCH] Fix transposing csv files with quoted fields

* csv-mode.el
(csv--collect-fields): New function.
(csv-transpose): Use the new function instead of split-string.

(Fixes Bug#46328)
---
 csv-mode.el | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/csv-mode.el b/csv-mode.el
index eaea881801..ecc33a7bcc 100644
--- a/csv-mode.el
+++ b/csv-mode.el
@@ -4,7 +4,7 @@
 
 ;; Author: "Francis J. Wright" <F.J.Wright@HIDDEN>
 ;; Maintainer: emacs-devel@HIDDEN
-;; Version: 1.14
+;; Version: 1.15
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
 ;; Keywords: convenience
 
@@ -1264,9 +1264,7 @@ When called non-interactively, BEG and END specify region to process."
 	      (forward-line)
 	    (let ((lep (line-end-position)))
 	      (push
-	       (split-string
-		(buffer-substring-no-properties (point) lep)
-		csv-separator-regexp)
+	       (csv--collect-fields lep)
 	       rows)
 	      (delete-region (point) lep)
 	      (or (eobp) (delete-char 1)))))
@@ -1305,6 +1303,26 @@ When called non-interactively, BEG and END specify region to process."
 	;; Re-do soft alignment if necessary:
 	(if align (csv-align-fields nil (point-min) (point-max)))))))
 
+(defun csv--collect-fields (row-end-position)
+  "Collect the fields of a row.
+Splits a row into fields, honoring quoted fields, and returns
+the list of fields.  ROW-END-POSITION is the end-of-line position.
+point is assumed to be at the beginning of the line."
+  (let ((csv-field-quotes-regexp (apply #'concat `("[" ,@csv-field-quotes "]")))
+	(row-text (buffer-substring-no-properties (point) row-end-position))
+	fields field-start)
+    (if (not (string-match csv-field-quotes-regexp row-text))
+	(split-string row-text csv-separator-regexp)
+      (save-excursion
+	(while (< (setq field-start (point)) row-end-position)
+	  (csv-forward-field 1)
+	  (push
+	   (buffer-substring-no-properties field-start (point))
+	   fields)
+	  (if (memq (following-char) csv-separator-chars)
+	      (forward-char)))
+	(nreverse fields)))))
+
 (defvar-local csv--header-line nil)
 (defvar-local csv--header-hscroll nil)
 (defvar-local csv--header-string nil)
-- 
2.30.1.windows.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46328; Package emacs. Full text available.

Message received at 46328 <at> debbugs.gnu.org:


Received: (at 46328) by debbugs.gnu.org; 5 Feb 2021 14:46:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 05 09:46:28 2021
Received: from localhost ([127.0.0.1]:43279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l82NQ-0002kS-AH
	for submit <at> debbugs.gnu.org; Fri, 05 Feb 2021 09:46:28 -0500
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55521)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1l82NP-0002fH-CF
 for 46328 <at> debbugs.gnu.org; Fri, 05 Feb 2021 09:46:27 -0500
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id 3C0B35C00BE
 for <46328 <at> debbugs.gnu.org>; Fri,  5 Feb 2021 09:46:22 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Fri, 05 Feb 2021 09:46:22 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:subject:date:message-id:mime-version:content-type; s=
 fm2; bh=Tcn9v4NCreXGyJt4kghoFdiXC+EOimHoIgQg3FZK32g=; b=VcBfNsHI
 /76/oB1uj1HJn3zZhF1ibAV/lS7uZ/6RyrMDDWKdlA+/oRdtUizohCSb97Z+zGhJ
 IiHvZjI5i4AFYlvRwJfkcmhFZOeTVFtF46TJYRjzQZkXwDjGVbL27FNrgyh2/Y1Z
 bpg67Nt0kgTMYQYzSL2+90bki/iOFzz3s3cAS1mwqJ/goN7O/DX7pJx9gNCt4HbH
 5K3wuV02ARYwZyjFspj3vi0Pc50b1mHdlpEhXLN/sMuhFfqAaAF/srBN9iwqKPrH
 UhYYP3Zas6wkzRYf3TjoDfB9N78jJ/YlLJkyv2oQ8k21MmhyxyIPXHeGsjPtGiMn
 f7JuNFHhP/r+cA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm2; bh=Tcn9v4NCreXGyJt4kghoFdiXC+EOi
 mHoIgQg3FZK32g=; b=tULlqR/qIKLtiGRneqAhdH4kR4hYs+cEpiZTU8WL0yt51
 ve2Ggl4/4aBgMNC9UD1r4gJSYVLj8wfx6iaa8mE0+aZd2d0X2fUw+vbhis/6qaeF
 JIfqwQUzmhA2yxSDPbLC++ric5zQYnJsIpwMr+JF9lXh3zyUd6Fj6g10/SohchWx
 8tp+XcHxZIHh+K6JgokiTFxeSd5l8BlLIXKvDusUiFmbgbHWcqwl8V+wxSVF9COn
 Jwqz+oEDYKE/oXCWX2fv+nP+Xhv7BXWFA8UzqhSFapRi1+SbVCZ6iiu+MPQ85Kfd
 QbjkwfPOlkS9+J/kv4J2WrjLUfr4yxqy2t8yb6obQ==
X-ME-Sender: <xms:PlodYIMErI5e7l4qi6Y-P77LrMm-IDkU8TNPV-hg1kClA8JSLWCB_g>
 <xme:PlodYO-5BVY6o-UQ8y6BjvlfZ-KkfMiqewtMEWIXjXS2Od7tVqb1v8HO5P3Tlq7P_
 Fca4RJqxHhZX7Bm>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgeeigdehhecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddttd
 enucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhm
 rghilhdrfhhmqeenucggtffrrghtthgvrhhnpedvgeeifffgueeugfeuieehueefiefgve
 evvdegveelleeugfejhfejgfevhfetudenucfkphepkeegrddvtdegrdduleefrddutdei
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguh
 hnsghinhesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:PlodYPQ8MWfIJSHkRDX3v15hg-7PPBhuV5U-kd8h-d52nP5WmWGQqg>
 <xmx:PlodYAuYjTqzTjMuKIr8RxOCMkBKJlrQS4qi5e9lfKI8bnUrk1qeQw>
 <xmx:PlodYAdjSxWMeN0ObDuTYZf6rLkgGozOnKpxIAipvqVqpx740y6VqA>
 <xmx:PlodYKpcOcvr4jzwVu9S8rD-DugG9sQE_vWphCHv9EpPM2Dd9wnbxw>
Received: from fgunbin.local (unknown [84.204.193.106])
 by mail.messagingengine.com (Postfix) with ESMTPA id AB980240064
 for <46328 <at> debbugs.gnu.org>; Fri,  5 Feb 2021 09:46:21 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: 46328 <at> debbugs.gnu.org
Subject: additional test case
Date: Fri, 05 Feb 2021 17:46:20 +0300
Message-ID: <m25z36efnn.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 46328
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

If there're two lines (csv-header-lines is 0, though):

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

Then the newlines are just prepended before commas inside the quoted
field:

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46328; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Feb 2021 14:17:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 05 09:17:47 2021
Received: from localhost ([127.0.0.1]:43246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l81vf-0000pC-Je
	for submit <at> debbugs.gnu.org; Fri, 05 Feb 2021 09:17:47 -0500
Received: from lists.gnu.org ([209.51.188.17]:47284)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1l81vd-0000p5-VP
 for submit <at> debbugs.gnu.org; Fri, 05 Feb 2021 09:17:46 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:36428)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <fgunbin@HIDDEN>)
 id 1l81vd-0004oS-MX
 for bug-gnu-emacs@HIDDEN; Fri, 05 Feb 2021 09:17:45 -0500
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36629)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <fgunbin@HIDDEN>)
 id 1l81vb-0007IX-Nj
 for bug-gnu-emacs@HIDDEN; Fri, 05 Feb 2021 09:17:45 -0500
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id B66A05C00D8
 for <bug-gnu-emacs@HIDDEN>; Fri,  5 Feb 2021 09:17:41 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Fri, 05 Feb 2021 09:17:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:subject:date:message-id:mime-version:content-type; s=
 fm2; bh=bLUT2yIG0idK1bCxCVvwyvK5YTYunLxWrsgsfbO2PVA=; b=XjKZTUOV
 KM0YXCKc54+lrdsxeF+Jnq7FStJx5hVbeM30UL9s4j/YWUCNQ4KoRZo84M39Bh/D
 2Q49Tnui3AEg/TAix4CcfxVhdHM5GhjjXr0ej0HN2h+vgtwtLmlZ2+51tl5Lmr8l
 TYYhTT+TZXGnvqjFqn1tXuInHyYUTUU20AZFPajNWOkpsUx4OKbmdal+TRUIR5hC
 yKgdsDu4GgPjNMxdP8sERdDxAKx/WUS0iB/PUUTkPOAk02TaAGL605vWaA8rRFgB
 SJ8Orvml4a9yQ5Ut5dQA+PClq4mU8SJS4FbkT0M5RyMkF/ryAszHQC1+ZY2Gpm28
 FWOMGL2YuQ4Ahw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm2; bh=bLUT2yIG0idK1bCxCVvwyvK5YTYun
 LxWrsgsfbO2PVA=; b=YVuw1vRJ7QSKVs2uTf8lJAur/EE24X3p7V2YFurHU4nRA
 so5p6HRWaPinhYBbdiXN916Huy2K0n6ptoH08IJ0StU/vd//3T7Ar93H4nO2+cl9
 tX4uiC1DNrSwfDhidg1VXseM59SZquJaIc5meOxoWw2eHfbLKvcwTVLIZoySTy1g
 8e0LwNEY3/f7jcqGWRGVehytgclCsEdJ5YNuEJIrguFsHprRBv0JfUp3udZ3bjuc
 vdehpX3mQNS3AWCwpiav7z/2l2k07thT/ZjFnAuBI8B+h8MSQRmXrAogj5BD5PhQ
 /iV0VhZ2PutkImK42mBeEYzoMdAdF6D/YQfLj8hgQ==
X-ME-Sender: <xms:hVMdYDYZYj_99nKYYTuOW2olzsBksCo6-aOhSRrVY0EX64vUSQBymQ>
 <xme:hVMdYCjBxDv7sbApI2f0527aitQM7zed9T6XFGKzIH-NX74jkrngJ-rJdd61_pKbv
 xnlNFnp8pIerTYL>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgeeigdeglecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddttd
 enucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhm
 rghilhdrfhhmqeenucggtffrrghtthgvrhhnpedvgeeifffgueeugfeuieehueefiefgve
 evvdegveelleeugfejhfejgfevhfetudenucfkphepkeegrddvtdegrdduleefrddutdei
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguh
 hnsghinhesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:hVMdYN43A2fdf2NGmO0L-19yiDgORNHeUf7wXhfpKP7GCIfg1OFzpA>
 <xmx:hVMdYB7-ZijzT3NfyDDjcP87oK2-6pDQpargWbBd7xluJFu32U4IMg>
 <xmx:hVMdYJc0u3GZZSVnkmgsCaSuiCkXQh6HGJr28H-K6uAvFhfl2ZW65g>
 <xmx:hVMdYFhba88UHJvazpb72LOvFRmEFr7hXSzDcFLVMtQUl1XmVZfdGA>
Received: from fgunbin.local (unknown [84.204.193.106])
 by mail.messagingengine.com (Postfix) with ESMTPA id 1AE8824005D
 for <bug-gnu-emacs@HIDDEN>; Fri,  5 Feb 2021 09:17:40 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; csv-transpose replaces field delimiters in quoted fields
 with newlines
Mail-Followup-To: bug-gnu-emacs@HIDDEN
Date: Fri, 05 Feb 2021 17:17:39 +0300
Message-ID: <m2wnvmegzg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=66.111.4.25; envelope-from=fgunbin@HIDDEN;
 helo=out1-smtp.messagingengine.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

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




Acknowledgement sent to Filipp Gunbin <fgunbin@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#46328; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 23 Feb 2021 16:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.