Hi,
I would like to know, why does libreoffice open up after running in a
terminal "libreoffice --convert-to odt *.doc?
What if I want a recursive behaviour?
Thank you for answering.
Sincerely.
Hi,
I would like to know, why does libreoffice open up after running in a
terminal "libreoffice --convert-to odt *.doc?
What if I want a recursive behaviour?
Thank you for answering.
Sincerely.
Hello,
I think the reason why LibreOffice is popping up after you run a --convert-to command is that you are not using --headless. The flag --headless hides the LibreOffice GUI, and only performs the operation specified. Also, it doesn't look like wildcards (the * that you used to indicate all the files in a directory) work with LibreOffice. I tested this command in a folder with a bunch of .doc files in it:
soffice --headless --convert-to odt *.doc
It did not produce any output.
However, the following command works correctly, and does not load LibreOffice afterwords:
soffice --headless --convert-to odt mydocfile.doc
(You would use the "libreoffice" command as it appears you are using Linux, but because I am using Windows, I have to use "soffice.")
So, since wildcards (at least for me) don't work with LibreOffice, you would have to create a script (if you wanted some kind of recursive automation that you mentioned) that looped through the files that you wanted to convert and ran the --convert-to command separately for each one. You can also use --outdir to change the output directory.
Here is an AskLO thread that may be useful: http://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/
I hope this helps!
Regards,
xmlhttprequest.open@gmail.com
Hi,
I would like to know, why does libreoffice open up after running in a
terminal "libreoffice --convert-to odt *.doc?
It should not do this. Check your installation again. (E.g:
http://www.mail-archive.com/users%40global.libreoffice.org/msg12280.html
http://www.mail-archive.com/users%40global.libreoffice.org/msg33265.html
What if I want a recursive behaviour?
Try:
libreoffice --convert-to odt ./*.doc
Hi,
Just tried "libreoffice --headless --convert-to odt *.doc* and it worked
like a charm.
Thank you!
Kind regards,
Ed
Hi,
1) Hmm, I didn't understand those links, the errors displayed are these:
javaldx: Could not find a Java Runtime Environment!
Warning: failed to read path from javaldx
2) I'm not an expert or a sysadmin but I read some books about Linux. ls
and ls . or ls ./ is the same.
3) I tried with - $ libreoffice --headless --convert-to odt $(ls -R)
- $ libreoffice --headless --convert-to odt < file < ls -R
- $ libreoffice --headless --convert-to odt $(find . -name "*.docx*")
- $ libreoffice --headless --convert-to odt $(find . -name "*.docx*")
--outdir dir/
and it didn't work out...
I know very little Bash and some C. I think a script it's a better idea.
It has to execute the libreoffice command in each directory so that the
outdir is "that" directory.
I wish somebody could code it. If not, I will do it myself in the future.
Sincerely,
Ed
Hi.
What are you trying to achieve.
I have to run a script to convert all older documents on our server to newer ODF format. I am going to do that by regression into the directory specified as the parameter to the script when called. I haven't got round to it yet as it is not required until I update LO, but is that what you are after.
Steve
Hi
Not sure about most of that but point 2
ls is the same as
ls . and
ls ./
it's just a bit of cleverness to try to get around weird limitations.
There shouldn't be any difference but what should be and what is are
sometimes different.
From the summary, i agree that it would be nice to have a neat little
gui program to point&click on but the point being made here was that
its an incredibly trivial thing to do and multiple easy ways of doing
it without going to much effort at all.
Despite it being really trivial in LO/AOO and probably other office
suites and programs it's an option apparently not offered by MS Office
and therefore considered "rocket science".
It might be nice to point it out in consultation exercises.
Regards from
Tom
Hi
Oooo, i wish someone had posted either of those conversion methods
(scripting and command-line using ./ as a trick to say "in the current
folder" seemingly unnecessarily) in the recent Uk Gov proposal to move
to ODF.
Of the tiny percentage of objections the point about converting
existing documents was used as the main reason for having to move to
OOXML! I pointed out that command-line and scripts would find it
easier to convert directly from Doc to Odt but actually knowing a
command to do so would have been fantastic!
Regards from
Tom
Another way is to use the wizard in libreoffice (File > Wizards > Document Converter ) from a PC on the same network than the server and using a network share.
We used this solution to convert tons of documents in order to avoid CPU charge on servers that were used for other purposes and it was nice (only I/O on the servers).
We were able to parallelize tasks with multiple PCs, each one was dealing with a dedicated sub-directory of the share.
Just my 2 cents.
1) Hmm, I didn't understand those links, the errors displayed are these:
javaldx: Could not find a Java Runtime Environment!
Warning: failed to read path from javaldx
You have another problem; activation of hyperlinks doesn't require java...
2) I'm not an expert or a sysadmin but I read some books about Linux. ls
and ls . or ls ./ is the same.
Depends on the subject; filenames with undesirable characters (e.g. m$
people adding spaces, strokes (/, \) etc.)
Hi Steve,
This is what I want: a script or a GUI program (preferably QT 4/5) that
converts doc/x documents with a recursive behaviour so that the files
that are converted didn't go to a special folder, just stay where the
doc/x documents are.
What do you think guys?
I wanted to take code from libreoffice (I suppose it's C) and program
the GUI interface with Python (using pyqt). It is not easy to learn all
this stuff. It took me some years to learn C doing a lot of excercises.
I also wanted to program an advanced string searcher like Super Finder
or like the Window$ XP searcher (Mom says that Window$ XP searcher is
better than the 7 one)
Kind regards,
Ed
Just tried it.
I found what I was searching.
Thank you!
Unfortunately for me it doesn't convert the legacy documents for which compatibility was discontinued after LO3.7, so I will finish my script.
steve
Hi
It is possible to still get earlier versions of LO! Install in
parallel or into a virtual machine or on a dual-boot or something.
The "in parallel is probably easiest unless you already have another
reason for having a vm or dual-boot.
Regards from
Tom
"e-letter":
filenames with undesirable characters (e.g. m$
people adding spaces, strokes (/, \) etc.)
Spaces are not 'undesirable characters.' \ and / are both invalid filename characters in Windows.
All your contribution to this newsgroup is spreading FUD about Microsoft software.
Who gives a ... about those desperately trying to maintain profitable m$ shares?
Are you sure you are not an M$ Corp paid troll you do sound alarmingly like one that
vanished a few years ago i think you may be it re named ...
Pete
+1
Pete