<div dir="ltr">Hi Omer,<br><br>Try pandoc (<a href="http://johnmacfarlane.net/pandoc/">http://johnmacfarlane.net/pandoc/</a>)?<br><br>I haven't played with it (just heard about it being used by some Wiki software and filed it away in my bookmarks), but one of its claims to fame is "convert markdown to ... OpenDocument... and ODT".<br>
<br>It won't solve the whole original problem but might be better than going through HTML.<br><br>--Amos<br><br>On 27 November 2011 10:22, Omer Zak <span dir="ltr"><<a href="mailto:w1@zak.co.il">w1@zak.co.il</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Matan,<br>
Thanks for the suggestion.<br>
<br>
The unoconv version 0.3-6 package in Debian Squeeze still depends upon<br>
some OpenOffice packages, which conflict with some LibreOffice packages,<br>
which I don't want to uninstall.<br>
<br>
However, I do have the Python uno module installed.<br>
I was referred by LibreOffice's help (search term 'API', item<br>
'Programming LibreOffice') to <a href="http://api.openoffice.org/" target="_blank">http://api.openoffice.org/</a> and from there<br>
found a code snippet for importing a plain text encoded with a given<br>
character set at<br>
<a href="http://codesnippets.services.openoffice.org/Writer/Writer.ImportingAPlainTextEncodedWithAGivenCharacterSet.snip" target="_blank">http://codesnippets.services.openoffice.org/Writer/Writer.ImportingAPlainTextEncodedWithAGivenCharacterSet.snip</a><br>
However, the code itself is missing - seems to have been removed at some<br>
time (nevermind the fact that it is said to be written in OOBasic rather<br>
than in Python/Java/CPP).<br>
<br>
Yet another possibility is to write a script in OOBasic, to be invoked<br>
from within LibreOffice.<br>
<br>
At the moment, conversion into HTML seems to be easier for me (I found<br>
that AbiWord can import an HTML file with suitable font declarations,<br>
and set the font correctly) - as it doesn't require me to cram yet<br>
another programming language (one less yak to shave!).<br>
<span class="HOEnZb"><font color="#888888"><br>
--- Omer<br>
</font></span><div class="im HOEnZb"><br>
<br>
On Sun, 2011-11-27 at 00:31 +0200, Matan Ziv-Av wrote:<br>
> On Sun, 27 Nov 2011, Omer Zak wrote:<br>
><br>
> > I need to convert several utf-8 encoded text files into MS-Word *.doc<br>
> > format. So I need to accomplish it from the command line.<br>
> > In Linux, it is easy to find tools to convert from MS-Word formats into<br>
> > text, but a Google search failed to yield converters in the opposite<br>
> > direction.<br>
> ><br>
> > I tried two word processors: LibreOffice and AbiWord.<br>
> ><br>
> > LibreOffice (version 1:3.4.3-3~bpo60+1 in Debian Squeeze - yes, it's a<br>
> > backport) allows you to perform the conversion, but you must go through<br>
> > a GUI. I did not find instructions how to accomplish this from the<br>
> > command line.<br>
><br>
> Libreoffice has a headless mode, where it accepts commands from a pipe.<br>
> unoconv is a nice command line front end for this mode.<br>
><br>
> Libreoffice also has --convert-to option. Try libreoffice --help to see<br>
> all options.<br>
<br>
--<br>
</div><div class="im HOEnZb">Did you shave a yak today?<br>
My own blog is at <a href="http://www.zak.co.il/tddpirate/" target="_blank">http://www.zak.co.il/tddpirate/</a><br>
<br>
My opinions, as expressed in this E-mail message, are mine alone.<br>
They do not represent the official policy of any organization with which<br>
I may be affiliated in any way.<br>
WARNING TO SPAMMERS: at <a href="http://www.zak.co.il/spamwarning.html" target="_blank">http://www.zak.co.il/spamwarning.html</a><br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</div></div></blockquote></div><br></div>