Skip to content

Excel file created by templater-json.jar is not a valid zip file #70

@asmaier

Description

@asmaier

I'm running the following command using templater 8.0.0 on Mac OS X 14.5 with java openjdk 21.0.2 2024-01-16 and zsh 5.9:

$ java -jar templater-json.jar templater_test.xlsx templater_test.json > templater_out.xlsx

When I try to unzip the output file I get

$ unzip templater_out.xlsx
Archive:  templater_out.xlsx
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of templater_out.xlsx or
        templater_out.xlsx.zip, and cannot find templater_out.xlsx.ZIP, period.

However I was also able to unzip the file using

$ jar xvf templater_out2.xlsx
 inflated: [Content_Types].xml
 inflated: _rels/.rels
 inflated: xl/_rels/workbook.xml.rels
 inflated: xl/workbook.xml
 inflated: xl/sharedStrings.xml
 inflated: xl/styles.xml
 inflated: xl/worksheets/sheet1.xml
 inflated: xl/theme/theme1.xml
 inflated: docProps/app.xml
 inflated: docProps/core.xml
 inflated: xl/worksheets/sheet2.xml

(see https://askubuntu.com/questions/54904/unzip-error-end-of-central-directory-signature-not-found)

And when I open the file Excel will also complain, but it is able to repair the file, see screenshots
Screenshot 2024-05-16 at 10 15 57
Screenshot 2024-05-16 at 10 16 19

Still it would be nice, if this issue could be fixed. Because many non-Excel tools will not be able to open the Excel file created by templater-json.jar, because it is not a valid zipfile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions