[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: [PATCH] quote the real csv separator

From: Łukasz Stelmach
Subject: [Orgmode] Re: [PATCH] quote the real csv separator
Date: Mon, 25 Oct 2010 10:45:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Bernt Hansen <address@hidden> writes:

> Łukasz Stelmach <address@hidden> writes:
>> Carsten Dominik <address@hidden> writes:
>>> What use case do you have in mind?
>> 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 <file> RET
> then C-x C-x marks the region and C-c | converts it to a table.

Cool :-) It works like charm. I'll have to check how to convert decimal
commas to periods. I still like '|' more for my perl script, though,
because it's enough to split '\|' and not care about quoted commas. But
this is my problem.

OK, I won't insist on keeping the patch but I would like to get a
rationale of :sep parameter in orgtbl-to-generic without a choice of how
to quote it. OR, if you think that CSV should stay as it is then I
suggest such a rewrite:

(defun orgtbl-to-csv (table params)
  (orgtbl-to-generic table (org-combine-plists
                            '(:sep "," :fmt org-quote-csv-field))))

to make CSV :sep and and :fmt mandatory (that's how this all have starded).

Miłego dnia,
Łukasz Stelmach

reply via email to

[Prev in Thread] Current Thread [Next in Thread]