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: Thu, 18 Jul 2013 14:49:16 +0530 Message-ID: <87a9lkns2z.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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzkLN-0001ak-9E for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 05:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzkLM-0002VC-9n for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 05:17:49 -0400 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:58917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzkLM-0002V7-4F for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 05:17:48 -0400 Received: by mail-pa0-f52.google.com with SMTP id kq14so1877322pab.25 for ; Thu, 18 Jul 2013 02:17:47 -0700 (PDT) In-Reply-To: <874nbszmfw.wl%jamshark70@dewdrop-world.net> (James Harkins's message of "Wed, 17 Jul 2013 21:28:03 -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 1. Give me a sample worksheet. 2. Give me the specific unoconv command that you used for converting the worksheet. If you do (1) and (2), I will post a recipe. James Harkins writes: > 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