3

I'm trying to batch convert some Excel schedules to CSV format from the command line with the following LibreOffice command:

libreoffice --convert-to csv *.xlsx

I'm getting:

error
xsltParseStylesheetFile : cannot parse 
I/O warning : failed to load external entity ""
error
xsltParseStylesheetFile : cannot parse 
convert file.xlsx -> file.csv using filter : Text - txt - csv (StarCalc)

I'm actually getting a csv file like this, but I also get a GUI-message saying "the maximum number of columns per sheet was exceeded."  Also I am getting lots of ��� for unsupported German characters ä ü ö.  Does anyone know how to fix those errors?


Update:

running: libreoffice --convert-to "txt:Text (encoded):UTF8" File.xlsx

I get:

Warning loading document File.xlsx:
The data could not be loaded completely because the maximum number of columns per sheet was exceeded.


              OK

  [manually transcribed from this image]

and on the command-line:

convert /home/user/File.xlsx -> /home/user/File.txt using filter : Text (encoded):UTF8
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///home/user/File.txt> failed: 0xc10(Error Area:Io Class:Write Code:16) /build/libreoffice-RsXkGA/libreoffice-7.0.1~rc1/sfx2/source/doc/sfxbasemodel.cxx:3153 /build/libreoffice-RsXkGA/libreoffice-7.0.1~rc1/sfx2/source/doc/sfxbasemodel.cxx:1735)

Might that be because of the Excel xlsx format?

3
  • 2
    Looking through the --help I found this line --convert-to "txt:Text (encoded):UTF8" *.doc Maybe it's possible to specify charset for CSV? No idea what "out of range" implies here, are there any other errors in the actual CSV?
    – Oskar Skog
    Commented Aug 22, 2020 at 17:46
  • @OskarSkog thanks for the answer, I updated my Question: "out of range" was a bad translation from German language. I changed the tty to english and made a screenshot :-)
    – nath
    Commented Aug 23, 2020 at 18:44
  • Looks like it is a really big spreadsheet, too big to fit in the available columns in LibreOffice Calc, can you confirm this?
    – Oskar Skog
    Commented Aug 25, 2020 at 12:25

1 Answer 1

1

Are you obliged to use libreoffice?

A great command-line tool to convert xlsx to csv is xlsx2csv

Description: convert xlsx files to csv format xlsx files are zip archives where spreadsheet data is stored. In order to process a file, various bits inside the archive need to be located. This utility uses the Expat SAX parser to collect the strings into a simple dictionary, keyed by their relative position in the XML file. This makes it possible to process files of any size.

Installation on a Debian-System:

sudo apt install xlsx2c

Simple usage:

xlsx2csv infile.xlsx outfile.csv
1
  • 1
    Sorry for the late reply and much thanks! Really great tool! No errors, very simple usage and plain output. No ��� forl ÄÖÜäöü…
    – nath
    Commented Dec 15, 2022 at 0:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .