Page 1 of 1

[Solved] Convert .ods file to csv

Posted: Wed May 18, 2016 10:19 pm
by CJenR
Hello!

Can someone help me to convert from .ods file to csv. I tried soffice --headless --convert-to csv filename.ods, but it is not working. It just opens the .ods file.

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 12:22 am
by acknak
Greetings and welcome to the community forum!

The command line you quoted works for me with AOO 4.1.2. You may need to track down what "soffice" at the command line actually does. It could be a shell script that doesn't process the options as expected. If so, directly starting the soffice executable that comes with OO using the full path (that's what I did when it worked).

Also, are you still using OO 3.4.1? That's pretty old at this point. It might be worth at least trying the current version.

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 11:13 am
by Villeroy
You've got to use LibreOffice rather than OpenOffice. The latter does not know any --convert-to option.

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 1:34 pm
by acknak
Ouch. Villeroy is exactly right. I should take my own suggestion: the "soffice" I was using was actually starting LibO, not AOO.

Sorry, my bad.

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 4:51 pm
by CJenR
Thank you for all the inputs!

Though soffice does not throw me any error, I believe as you said, it doesn't know --convert-to option. As of now I can not change openoffice version or to LibreOffice. Is there any other way to convert my ods file to csv in this AOO version?

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 4:57 pm
by RoryOF
What's wrong with /File /Save As : Text CSV (.csv) from the dropdown?

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 5:05 pm
by CJenR
No.. My shell script has to do it. No manual intervention. So, Is there any other ways to do it? or any other suggestion.

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 5:24 pm
by RoryOF
CJenR wrote:No.. My shell script has to do it. No manual intervention. So, Is there any other ways to do it? or any other suggestion.
You didn't say that - you asked about "file" in the singular.
Macro at
viewtopic.php?f=45&t=19695
and another at
viewtopic.php?f=9&t=2551
and more at
viewtopic.php?f=9&t=75404

These may need some fine tuning because of changes in OO/LibO code, but as you wish to use a macro you are no doubt prepared to do that.

Re: Convert .ods file to csv

Posted: Thu May 19, 2016 8:38 pm
by CJenR
I went through the links though I was hoping for a simpler solution instead of using a Macro :)
I came across unoconv package which can be used to convert files. I installed it and It worked as a charm.

Anyway thank you for helping me! 8-)