emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: Colin Williams <lackita@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Proposed patch for customizable org-table-export
Date: Wed, 29 Oct 2008 13:41:54 -0400	[thread overview]
Message-ID: <877i7rs3h9.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: <1b97198a0810282024q3aa44199s26bd2a166964345e@mail.gmail.com> (Colin Williams's message of "Tue\, 28 Oct 2008 23\:24\:38 -0400")

"Colin Williams" <lackita@gmail.com> 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

      reply	other threads:[~2008-10-29 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29  3:24 Proposed patch for customizable org-table-export Colin Williams
2008-10-29 17:41 ` Bernt Hansen [this message]

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877i7rs3h9.fsf@gollum.intra.norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=lackita@gmail.com \
    /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.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).