From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Re: Use babel to import table data from OpenDocument spreadsheets? Date: Wed, 17 Jul 2013 21:28:03 -0400 Message-ID: <874nbszmfw.wl%jamshark70@dewdrop-world.net> 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> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzd0s-0000Fs-2T for emacs-orgmode@gnu.org; Wed, 17 Jul 2013 21:28:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzd0r-0003Iy-1S for emacs-orgmode@gnu.org; Wed, 17 Jul 2013 21:28:10 -0400 Received: from mail-oa0-x234.google.com ([2607:f8b0:4003:c02::234]:63489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzd0q-0003It-RU for emacs-orgmode@gnu.org; Wed, 17 Jul 2013 21:28:08 -0400 Received: by mail-oa0-f52.google.com with SMTP id g12so3455268oah.25 for ; Wed, 17 Jul 2013 18:28:08 -0700 (PDT) Received: from dlm-A6200.gmail.com (cpe-98-157-146-44.ma.res.rr.com. [98.157.146.44]) by mx.google.com with ESMTPSA id z2sm11562176obi.3.2013.07.17.18.28.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 17 Jul 2013 18:28:07 -0700 (PDT) In-Reply-To: <87a9lv9ipq.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: orgmode At Wed, 10 Jul 2013 09:20:25 +0530, Jambunathan K wrote: > James Harkins writes: > > > I found a utility, unoconv[1], which I can persuade to produce a > > tab-separated export of the first worksheet of an ODS document. > > FYI, unoconv is an option provided by `org-odt-convert-processes'. Thanks. Okay... I finally had some time to come back to this task. While I do appreciate all the suggestions so far, unfortunately I have to admit that I'm still stuck. What I'd like to do now is run down what I know about it so far and put questions in the middle of that. 1. I have a LibreOffice ODS file, where the table to obtain will be in the first worksheet. 1a. I can use unoconv to get a tab-separated text table out of it, in a file on disk. 1b. I will need to invoke this synchronously in an emacs-lisp block. (shell-command ...) I guess, right? 2. I want the tab-separated text to be converted into an org-table, so that HTML export will turn it into an HTML table. This is where it becomes completely baffling to the novice. 2a. There's a function, org-table-import, which looks like it will do the job. It inserts the table contents at the point. I just can't find any examples online of the correct way to do this. I assume I will have to run an emacs-lisp source block. I had been thinking I could use ":exports results" with a #+call, supposing that I could write out the table text as a stream and those results would be put in place of the #+call in the export. But of course that doesn't make sense if org-table-import is significant for its side effect (modifying the buffer) rather than its result. 2b. So (I guess) I would have to use emacs-lisp to move the point to a specific location in the file before calling org-table-import (obviously not by character index, since I can't assume previous text will not change). QUESTION: What is the best way to do that? ^^ This is the point where I'm stuck. I really have no idea. Say I put in an org comment "# raw data here" -- how do I get the point to go to the line after that? How do I delete the entire old table before importing the new one? Working example, perhaps? Anyway, I'll be happy to write this up as a worg page after I get it working, as it seems to me this would be a fairly common need but the information is not easy to find. Thanks, hjh