emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: James Harkins <jamshark70@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: Use babel to import table data from OpenDocument spreadsheets?
Date: Fri, 19 Jul 2013 00:35:02 +0530	[thread overview]
Message-ID: <87mwpjzo2p.fsf@gmail.com> (raw)
In-Reply-To: <87r4evzo6j.fsf@gmail.com> (Jambunathan K.'s message of "Fri, 19 Jul 2013 00:32:44 +0530")

Jambunathan K <kjambunathan@gmail.com> writes:

> 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.



Here is a dump from my Messages buffer.


,----
| Executing libreoffice4.0 --headless --convert-to csv --outdir ~/ ~/html-table.ods
| convert ~/html-table.ods -> ~//html-table.csv using Text - txt - csv (StarCalc)
| 
| Exported to ~/html-table.csv
| Undo!
| Executing libreoffice4.0 --headless --convert-to csv --outdir ~/ ~/html-table.ods
| convert ~/html-table.ods -> ~//html-table.csv using Text - txt - csv (StarCalc)
| 
| Exported to ~/html-table.csv
`----




>
> James Harkins <jamshark70@gmail.com> 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

  reply	other threads:[~2013-07-18 19:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 14:10 Use babel to import table data from OpenDocument spreadsheets? James Harkins
2013-07-02 14:19 ` Jambunathan K
2013-07-02 14:30   ` James Harkins
2013-07-02 15:10     ` Jambunathan K
2013-07-03  2:35       ` James Harkins
2013-07-03  3:05         ` Jambunathan K
2013-07-10  2:19         ` James Harkins
2013-07-10  3:50           ` Jambunathan K
2013-07-18  1:28             ` James Harkins
2013-07-18  9:19               ` Jambunathan K
2013-07-18 15:42                 ` James Harkins
2013-07-18 19:02                   ` Jambunathan K
2013-07-18 19:05                     ` Jambunathan K [this message]
2013-07-18 21:32                     ` James Harkins
2013-07-10 21:31           ` Andreas Leha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwpjzo2p.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jamshark70@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).