wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.
https://csvkit.readthedocs.io
MIT License
6.03k stars 603 forks source link

BadZipFile when using -f xlsx --write-sheets - on STDIN #1225

Closed Konfekt closed 11 months ago

Konfekt commented 11 months ago

Running cat file.xlsx | in2csv -f xlsx --write-sheets - throws BadZipFile: File is not a zip file. Maybe https://stackoverflow.com/a/76780830/2241241 is of interest, as https://github.com/dilshod/xlsx2csv used it to implement reading from STDIN and works fine with --all, analogous to --write-sheets -.

jpmckinney commented 11 months ago

Thank you for reporting!

Fixed in 88753f9

The problem was that we were reading stdin twice (once for the data, once for the sheet names), which fails.