[Solved] Convert .ods file to csv

Discuss the spreadsheet application

[Solved] Convert .ods file to csv

Postby CJenR » Wed May 18, 2016 10:19 pm

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.
Last edited by Hagar Delest on Thu May 19, 2016 8:59 pm, edited 1 time in total.
Reason: tagged [Solved].
- CJ
OpenOffice 3.4.1. Calc on Linux
CJenR
 
Posts: 4
Joined: Wed May 18, 2016 10:15 pm

Re: Convert .ods file to csv

Postby acknak » Thu May 19, 2016 12:22 am

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.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Convert .ods file to csv

Postby MrProgrammer » Thu May 19, 2016 1:41 am

Hi, and welcome to the forum.

CJenR wrote:I tried soffice --headless --convert-to csv filename.ods, but it is not working.
"it is not working" isn't helpful in the forum because it tells us what did not happen. Please never use that phrase in a post. We need to know exactly what actions you took, what did happen, and what you expected to happen. Often "it didn't work" means "it didn't do what I expected" and the real problem is that the system is behaving correctly but your expectations are incorrect.

Perhaps your problem is that the operating system can't find the soffice module. Help it by providing the full path in the command, which in my case is /Applications/OpenOffice.org.app/Contents/MacOS/soffice …, or by using the cd command to make the directory containing soffice the current directory and using ./soffice ….

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.5 Build 9789 on MacOS 10.11.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Volunteer
 
Posts: 3619
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Convert .ods file to csv

Postby Villeroy » Thu May 19, 2016 11:13 am

You've got to use LibreOffice rather than OpenOffice. The latter does not know any --convert-to option.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26415
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Convert .ods file to csv

Postby acknak » Thu May 19, 2016 1:34 pm

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.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Convert .ods file to csv

Postby CJenR » Thu May 19, 2016 4:51 pm

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?
- CJ
OpenOffice 3.4.1. Calc on Linux
CJenR
 
Posts: 4
Joined: Wed May 18, 2016 10:15 pm

Re: Convert .ods file to csv

Postby RoryOF » Thu May 19, 2016 4:57 pm

What's wrong with /File /Save As : Text CSV (.csv) from the dropdown?
Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Convert .ods file to csv

Postby CJenR » Thu May 19, 2016 5:05 pm

No.. My shell script has to do it. No manual intervention. So, Is there any other ways to do it? or any other suggestion.
- CJ
OpenOffice 3.4.1. Calc on Linux
CJenR
 
Posts: 4
Joined: Wed May 18, 2016 10:15 pm

Re: Convert .ods file to csv

Postby RoryOF » Thu May 19, 2016 5:24 pm

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
https://forum.openoffice.org/en/forum/viewtopic.php?f=45&t=19695
and another at
https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=2551
and more at
https://forum.openoffice.org/en/forum/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.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Convert .ods file to csv

Postby CJenR » Thu May 19, 2016 8:38 pm

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-)
- CJ
OpenOffice 3.4.1. Calc on Linux
CJenR
 
Posts: 4
Joined: Wed May 18, 2016 10:15 pm


Return to Calc

Who is online

Users browsing this forum: camo and 50 guests