1

Is it possible to convert a xls or csv file on MSWindows without opening Calc (Libre office) from command line.

This is partial solution :

path = "C:\Program Files (x86)\LibreOffice 4\program"

scalc --invisible -convert-to dbf C:\mydata\MATIKGL.xls

But the batch file must be in c:\mydata. Is it possible to set the input and output folder in a second line?

Reference

https://help.libreoffice.org/Common/Starting_the_Software_With_Parameters

z--
  • 2,186
  • 17
  • 33
Jovica Bozic
  • 97
  • 1
  • 12
  • Don't think libreoffice offers conversion functions from the command line. However it is possible to write a utility which will be able to do what you want. – Quaternion Mar 06 '14 at 01:19
  • Could you help me out? write with what, i know my way around vba but thats all. – Jovica Bozic Mar 06 '14 at 01:34
  • I've found this one but can not make it to work : https://help.libreoffice.org/Common/Starting_the_Software_With_Parameters – Jovica Bozic Mar 06 '14 at 09:09
  • Please add what you have tried to your question. And use a subdirectory to do the conversion, not the root level of the C: drive. – z-- Mar 06 '14 at 12:57
  • I think this is actually a question about Windows batch scripting rather than LibreOffice. If I had seen this question six years ago, I might've recommended some of the resources [here](https://ss64.com/links/windows.html). – TheDudeAbides Sep 26 '20 at 00:15

1 Answers1

2

Make sure you have C:\Program Files\LibreOffice 4.n\programs in the path.

Use the program soffice or scalc. You can get help with scalc --help

Use the option --convert-to dbf

See also Libreoffice convert-to not working

Community
  • 1
  • 1
z--
  • 2,186
  • 17
  • 33
  • I think I've tried everything. Only thing that works is putting batch file where the xls file is. Beside the fact that batch can not work from other folder (with these lines) : path = "C:\Program Files (x86)\LibreOffice 4\program" scalc --invisible -convert-to dbf C:\X\MATIKGL.xls also output folder can not be set, tried all combinations. Could you please help me with this one? Thanks. – Jovica Bozic Mar 06 '14 at 16:51