From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joost Helberg Subject: Re: org-export to Spreadsheet Date: Thu, 23 Aug 2012 17:55:30 +0200 (CEST) Message-ID: <20120823.175530.855622578083131066.joost@snow.nl> References: <20120823.103426.2236953666490845835.joost@snow.nl> <876289lvql.fsf@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Zkv-0006bp-So for emacs-orgmode@gnu.org; Thu, 23 Aug 2012 11:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4Zku-0008Ee-61 for emacs-orgmode@gnu.org; Thu, 23 Aug 2012 11:55:37 -0400 Received: from mx.snow.nl ([213.154.248.146]:38413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Zkt-0008ES-TP for emacs-orgmode@gnu.org; Thu, 23 Aug 2012 11:55:36 -0400 In-Reply-To: <876289lvql.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: kjambunathan@gmail.com Cc: emacs-orgmode@gnu.org Jambunathan, Thanks for the code, it will probably match what I need. Regards, Joost >>>>> "Jambunathan" == Jambunathan K writes: > Subject: Re: org-export to Spreadsheet > From: Jambunathan K > To: Joost Helberg > Cc: emacs-orgmode@gnu.org > Date: Thu, 23 Aug 2012 16:29:30 +0530 > Joost Helberg writes: >> ls, >> >> org-export-odt-preferred-output-format doesn't support ods or xlsx. >> Libreoffice is incapable of converting odt to ods, which is the main >> reason, as far as I can see, for org-export-odt to not deliver this >> service. > LibreOffice is a collection of document classes - Writer is a "Text > document", Calc is a "Spreadsheet document" and Impress is a > "Presentation document". > LibreOffice provides filters - in common man's terms, what you with > "Save as" - from one format to another within the *same* document class > but *not* *across* document classes. > For example, you can move between "doc" file and "odt" file because both > are text documents. You can move between "csv" and "ods" because both > are spreadsheet documents. But you cannot move between odt and ods > because you are moving between text document to spreadsheet document. > This is exactly the reason why, when you do > M-x customize-variable RET org-export-odt-preferred-format RET > you will see only "Text formats" like doc etc in the drop down list and > not xls or ods. >> After exporting my calldata reports to odt, I end up `selecting >> all' in libreoffice, creating a new spreadsheet and pasting all into >> this new spreadsheet. Of course, as a org-mode user, I hate all this >> interaction with GUI programs. > The trick is to use M-x org-table-export RET to export a org-table to > csv format and then convert that csv file to ods format. > For the sake of illustration, > 1. Install below function > (defun org-export-to-ods () > (interactive) > (let ((csv-file "data.csv")) > (org-table-export csv-file "orgtbl-to-csv") > (org-export-odt-convert csv-file "ods" 'open))) > 2. Put your cursor on a table > 3. Do M-x org-export-to-ods > You will see that the table is exported to a spreadsheet and it is > opened. > TIP: > 1. You can replace "csv" to "tsv". > 2. You can replace "ods" with "xls" or "xlsx" > 3. You will get a spreadsheet but not any of the meta-data transferred. > For example, no transference of TBLFM lines or recognition of > spreadsheet fields like number, date etc. > 4. LibreOffice's command line converter - this I suppose being new - has > some issues if LibreOffice application is already running. So if you > are exporting multiple tables you can replace 'open in the above > function with nil. >> I was wondering whether there is a better way to do this, or if a >> minor add-on would facilitate this (C-c C-e s|S maybe?). > There was a prior request to convert org-tables to LibreOffice Calc > directly - so that some TBLFM lines could be transferred. But this > cannot be done in a day or two and requires more efforts (and may > necessitate improvement of org-element/org-export infrastructure) >> regards, >> >> Joost > -- -- Snow B.V. http://snow.nl