From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Use babel to import table data from OpenDocument spreadsheets? Date: Fri, 19 Jul 2013 00:32:44 +0530 Message-ID: <87r4evzo6j.fsf@gmail.com> References: <87k3l9kq78.wl%jamshark70@dewdrop-world.net> <878v1pvybk.fsf@gmail.com> <87y59p591f.wl%jamshark70@dewdrop-world.net> <87y59p80b3.fsf@gmail.com> <87vc4s5q0o.wl%jamshark70@dewdrop-world.net> <87ip0j5f8q.wl%jamshark70@dewdrop-world.net> <87a9lv9ipq.fsf@gmail.com> <874nbszmfw.wl%jamshark70@dewdrop-world.net> <87a9lkns2z.fsf@gmail.com> <8738rbzxgn.wl%jamshark70@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UztS1-000512-2j for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 15:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UztRz-0006Zo-8U for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 15:01:17 -0400 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]:47774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UztRz-0006Za-1g for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 15:01:15 -0400 Received: by mail-pa0-f44.google.com with SMTP id lj1so3543423pab.3 for ; Thu, 18 Jul 2013 12:01:13 -0700 (PDT) In-Reply-To: <8738rbzxgn.wl%jamshark70@dewdrop-world.net> (James Harkins's message of "Thu, 18 Jul 2013 11:42:16 -0400") 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: James Harkins Cc: orgmode I don't want to venture in to Babel. I don't want to experiment with unoconv either. I have a non-official libreoffice installed. Pulling in official unoconv will interfere with my working installation. For your purposes, just soffice will do. (defun org-table-import-ods (&optional file-name) (interactive "fFile: ") (let ((csv-file (org-odt-convert file-name "csv")) (pos (point))) (save-excursion (insert (with-temp-buffer (insert-file-contents csv-file) (org-table-convert-region (point-min) (point-max) '(4)) (buffer-string)))))) | Simple | Table | | 1 | 10 | | 2 | 20 | | 3 | 30 | Remember to close all libreoffice applications. THIS IS IMPORTANT. Otherwise `org-odt-convert' will error out. 0. Visit scratch buffer 1. Install the above snippet 2. Go to end of the scratch buffer. 3. M-x org-table-import-ods RET You will see something like what I see above. James Harkins writes: > At Thu, 18 Jul 2013 14:49:16 +0530, > Jambunathan K wrote: >> 1. Give me a sample worksheet. > > Attached. > >> 2. Give me the specific unoconv command that you used for converting the >> worksheet. > > unoconv -f csv -i 9,34,system,1,1/5/2/1/3/1/4/1 html-table.ods > > Maybe the filename needs a full path, not sure. I can supply that later. > >> If you do (1) and (2), I will post a recipe. > > Really appreciate that! > > hjh