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
5.9k stars 605 forks source link

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

Closed Konfekt closed 6 months ago

Konfekt commented 6 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 6 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.