Bug 152446 - Not able to "cat" the text contents of .xls or .ods files to stdout.
Summary: Not able to "cat" the text contents of .xls or .ods files to stdout.
Status: RESOLVED DUPLICATE of bug 70625
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha1+
Hardware: All Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-09 21:27 UTC by Tagwerk
Modified: 2022-12-10 09:47 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tagwerk 2022-12-09 21:27:05 UTC
SUMMARY

    Not able to "cat" the text contents of .xls or .ods files to stdout.

STEPS TO REPRODUCE:

    Installed the LibreOffice dev 7.5 version

    Downloaded test files from https://bugs.kde.org

    baloo_test_Libreoffice_7.4.2.3.doc
        https://bugs.kde.org/attachment.cgi?id=153915
    baloo_test_libreoffice.ppt
        https://bugs.kde.org/attachment.cgi?id=153918
    baloo_test_libreoffice.xls
        https://bugs.kde.org/attachment.cgi?id=153919

    And try to stream the contents the file to stdout, in this case
    comparing the behaviour of .doc and .xls:

    $ libreofficedev7.5 --cat baloo_test_Libreoffice_7.4.2.3.doc
    $ libreofficedev7.5 --cat baloo_test_libreoffice.xls

OBSERVED RESULTS:

    $ libreofficedev7.5 --cat baloo_test_Libreoffice_7.4.2.3.doc
    This worked, the text contents were displayed.

    $ libreofficedev7.5 --cat baloo_test_libreoffice.xls
    Failed with:
        javaldx: Could not find a Java Runtime Environment!
        Warning: failed to read path from javaldx
        warn:sc:3407:3407:sc/source/filter/excel/xlroot.cxx:160: XclRootData::XclRootData - cannot get output device info com.sun.star.uno.RuntimeException message: "invalid attempt to assign an empty interface of type com.sun.star.frame.XFrame! at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/include/com/sun/star/uno/Reference.hxx:105"
        warn:sfx.doc:3407:3407:sfx2/source/doc/sfxbasemodel.cxx:3166: Storing has failed, no error is set!
        Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///tmp/lu3407b9ahr.tmp/lu3407b9ahs.tmp> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sfx2/source/doc/sfxbasemodel.cxx:3215 at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sfx2/source/doc/sfxbasemodel.cxx:1789)

    The test also failed after the .xls was saved as an .ods

EXPECTED RESULTS:

    It's possible to "cat" an .xls or .ols file to stdout in the same way as
    a .doc or .odt file

    It is not expected that spreadsheet formatting is preserved; it is
    "streaming text" and not streaming a converted CSV format.

VERSION:

    $ libreofficedev7.5 --version
    LibreOfficeDev 7.5.0.0.alpha1 8f34b0d40e149b7274a1aa4ce0b33ddbf825ee52

    The dev version was tried after reading Bug 150846, don't know
    whether this is a long established bug or a recent regression

ADDITIONAL INFORMATION

    Trying to convert the.xls/.ods to a text file also fails:

        $ libreofficedev7.5 --headless --convert-to "txt:Text (encoded):UTF8" baloo_test_libreoffice.xls
        javaldx: Could not find a Java Runtime Environment!
        Warning: failed to read path from javaldx
        warn:sc:4110:4110:sc/source/filter/excel/xlroot.cxx:160: XclRootData::XclRootData - cannot get output device info com.sun.star.uno.RuntimeException message: "invalid attempt to assign an empty interface of type com.sun.star.frame.XFrame! at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/include/com/sun/star/uno/Reference.hxx:105"
        convert /home/test/Downloads/baloo_test_libreoffice.xls -> /home/test/Downloads/baloo_test_libreoffice.txt using filter : Text (encoded):UTF8
        warn:sfx.doc:4110:4110:sfx2/source/doc/sfxbasemodel.cxx:3166: Storing has failed, no error is set!
        Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///home/test/Downloads/baloo_test_libreoffice.txt> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sfx2/source/doc/sfxbasemodel.cxx:3215 at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sfx2/source/doc/sfxbasemodel.cxx:1789)

    Whereas trying to convert to a .csv file works, albeit with a
    "cannot get output device" warning:

        $ libreofficedev7.5 --headless --convert-to "csv" baloo_test_libreoffice.xls
        javaldx: Could not find a Java Runtime Environment!
        Warning: failed to read path from javaldx
        warn:sc:3707:3707:sc/source/filter/excel/xlroot.cxx:160: XclRootData::XclRootData - cannot get output device info com.sun.star.uno.RuntimeException message: "invalid attempt to assign an empty interface of type com.sun.star.frame.XFrame! at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/include/com/sun/star/uno/Reference.hxx:105"
        convert /home/test/Downloads/baloo_test_libreoffice.xls -> /home/test/Downloads/baloo_test_libreoffice.csv using filter : Text - txt - csv (StarCalc)

    Converting to a .pdf also works with the same warning:

        $ libreofficedev7.5 --headless --convert-to "pdf" baloo_test_libreoffice.xls
        javaldx: Could not find a Java Runtime Environment!
        Warning: failed to read path from javaldx
        warn:sc:1302:1302:sc/source/filter/excel/xlroot.cxx:160: XclRootData::XclRootData - cannot get output device info com.sun.star.uno.RuntimeException message: "invalid attempt to assign an empty interface of type com.sun.star.frame.XFrame! at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/include/com/sun/star/uno/Reference.hxx:105"
        convert /home/test/Downloads/baloo_test_libreoffice.xls -> /home/test/Downloads/baloo_test_libreoffice.pdf using filter : calc_pdf_Export

    The error messages look similar to those reported in Bug 150846.
~
Comment 1 Mike Kaganski 2022-12-10 09:47:11 UTC
Note that the initial implementation of --cat in bug 70625 only handled the text files; that is reflected in the help [1] explicitly mentioning *text* files; and the original issue is open with the comment:

> This needs extending to spreadsheet & impress formats

[1] https://help.libreoffice.org/7.4/en-US/text/shared/guide/start_parameters.html?DbPAR=SHARED

*** This bug has been marked as a duplicate of bug 70625 ***