From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: [PATCH] quote the real csv separator Date: Sun, 24 Oct 2010 21:25:00 -0400 Message-ID: <87tykbqd1v.fsf@gollum.intra.norang.ca> References: <87mxq4wman.fsf@kotik.lan> <57E157F5-BDE7-4431-B15F-8EE52E571677@gmail.com> <871v7f8gfl.fsf@kotik.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=43784 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PABoJ-0006sF-5J for emacs-orgmode@gnu.org; Sun, 24 Oct 2010 21:25:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PABo9-0000R1-4k for emacs-orgmode@gnu.org; Sun, 24 Oct 2010 21:25:11 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:64567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PABo9-0000Qi-2G for emacs-orgmode@gnu.org; Sun, 24 Oct 2010 21:25:05 -0400 In-Reply-To: <871v7f8gfl.fsf@kotik.lan> (=?utf-8?Q?=22=C5=81ukasz?= Stelmach"'s message of "Sun, 24 Oct 2010 22:49:18 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?=C5=81ukasz?= Stelmach Cc: emacs-orgmode@gnu.org =C5=81ukasz Stelmach writes: > Carsten Dominik writes: > >> On Oct 24, 2010, at 12:56 AM, =C5=81ukasz Stelmach wrote: >> >>> I'd rather use an optional sep argument to the org-quote-csv-field >>> function but I've got no idea how to stick it into the orgtbl-apply- >>> fmt. However, the quoting function should use current rather then >>> assume comma. >>> > [...] >>> >> thanks for the patch, but I do not understand it. >> >> The separator for csv is always the comma, or am I wrong here? > > A bit. The fact is that both OpenOffice (i've just checked) and > Microsoft Office (I am almost 100% sure) allow to choose the separator > upon export. And org-mode also allows it with radio tables with the :sep > parameter (which is passed to the generic exporter). > >> So this function should use comma, hard-coded. The only place >> where it is used is when orgtbl-to-csv calls the generic >> exporter. It does so with comma as separator and with >> org-quote-csv-field as formatting function. >> >> What use case do you have in mind? > > For me in particular? This is quite complicated ;-) And if you decide to > reject the patch I will understand. (Read only I you have some time to > waste ;) > > My bank lets me download monthly reports as CSV. In fact they let me > choose the separator and the default value is the comma. But I choose > '|' because then I can open the csv as org file and just do > > (replace-regexp "^" "|") > > to get a beautiful org-mode table. There is an easier org-mode way I think. Just get the comma delimited data into your org file, select the region and C-c | to get your table. If you are inserting an external file with C-x i RET then C-x C-x marks the region and C-c | converts it to a table. If this works better for you then I would suggest dropping the patch. Regards, Bernt