From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Proposed patch for customizable org-table-export Date: Wed, 29 Oct 2008 13:41:54 -0400 Message-ID: <877i7rs3h9.fsf@gollum.intra.norang.ca> References: <1b97198a0810282024q3aa44199s26bd2a166964345e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvF3S-0000h8-Ho for emacs-orgmode@gnu.org; Wed, 29 Oct 2008 13:42:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvF3R-0000gK-Jv for emacs-orgmode@gnu.org; Wed, 29 Oct 2008 13:42:01 -0400 Received: from [199.232.76.173] (port=56536 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvF3R-0000g8-2b for emacs-orgmode@gnu.org; Wed, 29 Oct 2008 13:42:01 -0400 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:52003) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvF3Q-0000Mo-HH for emacs-orgmode@gnu.org; Wed, 29 Oct 2008 13:42:00 -0400 In-Reply-To: <1b97198a0810282024q3aa44199s26bd2a166964345e@mail.gmail.com> (Colin Williams's message of "Tue\, 28 Oct 2008 23\:24\:38 -0400") 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: Colin Williams Cc: emacs-orgmode@gnu.org "Colin Williams" writes: > I've created the custom variable org-table-export-delimiter so that the user > may customize the string that delimits the columns exported. > > I believe this is useful because in some areas (namely, my office) people > insist on the files being in csv (comma separated values). > > I've also noticed (but haven't bothered fixing yet) that if a field contains > the delimiter string (be it a tab or a comma), then the resulting exported > file has misaligned columns. In csv format, this is remedied by surround > the offending columns in double quotes. I'm not sure, but I believe tab > separated format usually handles separator character disambiguation in a > similar way. > > I've attached the patch for my change, but as this patch is the first thing > I've contributed to org-mode, I'm still waiting on the paperwork from the > gnu foundation. Also, I've actually never contributed a patch to a free > project before, so I'm sorry if the patch file is incorrectly formatted. My version of org-mode already exports in CSV format just fine. I create a test file ,----[ x.org ] | | Z | B | C | D | | |-------+-------+-------+---------| | | 1 | 2 | 3 | 4 | | | 7,234 | 7,222 | 154.0 | 11 | | | abc | def | ghi | jkl,lmn | `---- M-x org-table-export prompts for a filename (x.csv) and a format orgtbl-to-csv and I get this ,----[ x.csv ] | Z,B,C,D | 1,2,3,4 | "7,234","7,222",154.0,11 | abc,def,ghi,"jkl,lmn" `---- I have the following settings in my .emacs since I export to CSV by default ,---- | (setq org-table-export-default-format "orgtbl-to-csv") `---- Org-mode version 6.10c (release_6.10c-20-g17c55f1 <- from git describe) which is 20 commits after the release_6.10c tag on commit 17c55f1b10b2ad77b830bc057c722ffc99611337 ^^^^^^^ This has been available for a long time I believe. -Bernt