Bug 117312 - command line option '--cat'
Summary: command line option '--cat'
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:6.3.0
Depends on:
Reported: 2018-04-28 11:07 UTC by Luuk
Modified: 2022-12-10 10:57 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

TEST.ods (9.20 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-04-28 11:07 UTC, Luuk
TEST.odt (9.21 KB, application/vnd.oasis.opendocument.text)
2019-01-12 10:52 UTC, Luuk
TEST.pdf (7.28 KB, application/pdf)
2019-01-12 11:27 UTC, Luuk

Note You need to log in before you can comment on or make changes to this bug.
Description Luuk 2018-04-28 11:07:08 UTC
Created attachment 141736 [details]

On linux:
luuk@opensuse:~/tmp> ooffice --version
LibreOffice 00m0(Build:2)

luuk@opensuse:~/tmp> ooffice --cat TEST.ods
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///tmp/zfWxIZ> failed: 0xc10)

on windows:
D:\TEMP>"C:\Program Files\LibreOffice\program\soffice.exe"  --version

LibreOffice 8f48d515416608e3a835360314dac7e47fd0b821

D:\TEMP>"C:\Program Files\LibreOffice\program\soffice.exe"  --cat TEST.ods


On linux i do get an unexpected error, 
On windows no error AND no output
Comment 1 Xisco Faulí 2018-05-30 10:08:41 UTC
I can't reproduce it in

Build ID: 1:6.0.4~rc2-0ubuntu0.16.04.1
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

soffice --cat /home/xisco/Escriptori/Untitled\ 1.odt works for me!!

Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 2 QA Administrators 2018-12-03 13:13:32 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2019-01-11 15:26:56 UTC Comment hidden (obsolete)
Comment 4 Xavier Van Wijmeersch 2019-01-11 19:31:25 UTC
repro with
In a terminal

soffice --version => i have this result

LibreOfficeDev 62142168e42a050d052d7d75fafd8f6e9cf2a1af (gtk2)

soffice --cat somewhere/file.odt => I have no output when i tested with a file
Comment 5 Luuk 2019-01-12 10:51:54 UTC
Sorry for later reply, and thanks to Xavier for posting that he has the same problem.

The problem is still there:
D:\TEMP>"C:\Program Files\LibreOffice\program\soffice.exe" --version

LibreOffice 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3

D:\TEMP>"C:\Program Files\LibreOffice\program\soffice.exe" --cat TEST.odt

D:\TEMP>"C:\Program Files\LibreOffice\program\soffice.exe" --cat TEST.ods


(TEST.odt will be uploaded soon, TESTods is the file I uploaded earlier )
Comment 6 Luuk 2019-01-12 10:52:36 UTC
Created attachment 148259 [details]
Comment 7 Luuk 2019-01-12 11:27:59 UTC
Created attachment 148260 [details]

Also converting from command-line works
"C:\Program Files\LibreOffice\program\soffice.exe" --convert-to pdf d:\temp\TEST.odt
Comment 8 Xisco Faulí 2019-01-14 10:01:41 UTC
Maybe a duplicate of bug 112536 which is fixed in master?
Could you please try to reproduce it with a master build from http://dev-builds.libreoffice.org/daily/master/ ?
You can install it alongside the standard version.
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the master build
Comment 9 Mike Kaganski 2019-01-14 10:18:29 UTC
1. The problem of not getting any output on Windows is indeed tdf#112536, and is fixed now.

2. --cat does work for me with .odt files; when using with debug builds, one needs to consider the debug output that gets emitted by LibreOffice to stderr, and mixed with the output to stdout when seen in terminal; so the best way to see if something is actually output is using command line like

> soffice --cat path/to/file.odt > path/to/out.txt

so that out.txt would contain only the stdout data, while console would get all warnings/info from stderr.

3. --cat does *not* work for me with .ods; *possibly* that's expected that we only output the content for text documents, not other types of documents - I suppose we use "plain text" output filter for the loaded document, which would fail for spreadsheets.
Comment 10 Mike Kaganski 2019-01-14 10:25:08 UTC
Also please note that to use LibreOffice in console mode, after the fix for tdf#112536, you should *not* use the soffice.exe (which is GUI launcher); you should either omit the executable's extension, or use new soffice.com to have proper console mode (omitting the extension *by default* prefers .com over .exe in console - subject to PATHEXT environment variable [1]).

[1] https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/start
Comment 11 Mike Kaganski 2019-01-14 12:08:48 UTC
I confirm that --cat is implemented internally as setting output filter to "txt:Text", performing the usual conversion to a temporary file, and then putting the content of that temporary file to stdout. Thus, it only works for documents opened as text documents (i.e., using Writer component which has "Text (.txt)" output filter).

The wording of our help [1]

> Dump text content of the following files to console

could be improved to mention this limitation. So this should be changed to the documentation/help issue.

[1] https://help.libreoffice.org/6.1/en-US/text/shared/guide/start_parameters.html
Comment 12 Xisco Faulí 2019-01-14 14:37:37 UTC
Setting to NEW and Documentation as per comment 11
Comment 13 Commit Notification 2019-01-14 18:30:03 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":


tdf#117312 clarify --cat in start parameters