From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: org-export to Spreadsheet Date: Thu, 23 Aug 2012 16:29:30 +0530 Message-ID: <876289lvql.fsf@gmail.com> References: <20120823.103426.2236953666490845835.joost@snow.nl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4V7o-0004Lz-Ol for emacs-orgmode@gnu.org; Thu, 23 Aug 2012 06:59:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4V7n-0005Vy-E2 for emacs-orgmode@gnu.org; Thu, 23 Aug 2012 06:58:56 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:42487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4V7n-0005Vp-7s for emacs-orgmode@gnu.org; Thu, 23 Aug 2012 06:58:55 -0400 Received: by pbbro12 with SMTP id ro12so1227159pbb.0 for ; Thu, 23 Aug 2012 03:58:54 -0700 (PDT) In-Reply-To: <20120823.103426.2236953666490845835.joost@snow.nl> (Joost Helberg's message of "Thu, 23 Aug 2012 10:34:26 +0200 (CEST)") 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: Joost Helberg Cc: emacs-orgmode@gnu.org 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 --