shenwei356 / csvtk

A cross-platform, efficient and practical CSV/TSV toolkit in Golang
http://bioinf.shenwei.me/csvtk
MIT License
999 stars 84 forks source link

xlsx2csv can't correct open blank sheet #204

Closed litd closed 1 year ago

litd commented 1 year ago

Prerequisites

Describe your issue

Thank you

I'm grateful to users who have greatly helped to report bugs and suggested new features.

I may respond to issues or fix bugs quickly, but I usually implement new features periodically (two or more weeks).

using current version of csvtk to convert xlsx file to csv ones, certain sheets contain no data, still want to output blank files instead of error mesg.

Thanks!

csvtk version csvtk v0.24.0

$ csvtk xlsx2csv Tissue_and_TMA_for_Nanostring_RPed.xlsx -i 3 | csvtk csv2tab [ERRO] xopen: no content panic: runtime error: makeslice: len out of range

goroutine 1 [running]: github.com/shenwei356/csvtk/csvtk/cmd.glob..func51(0x141a2a0, {0xc000187860, 0x1, 0x3}) /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/csvtk/csvtk/cmd/xlsx2csv.go:119 +0x666 github.com/spf13/cobra.(Command).execute(0x141a2a0, {0xc000187830, 0x3, 0x3}) /home/shenwei/shenwei/scripts/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x5f8 github.com/spf13/cobra.(Command).ExecuteC(0x1417aa0) /home/shenwei/shenwei/scripts/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc github.com/spf13/cobra.(*Command).Execute(...) /home/shenwei/shenwei/scripts/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/shenwei356/csvtk/csvtk/cmd.Execute() /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/csvtk/csvtk/cmd/root.go:71 +0x25 main.main() /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/csvtk/csvtk/main.go:54 +0x17

shenwei356 commented 1 year ago

I plan to let most of the commands allow empty files. Before that, please use the binary first. (only xlsx2csv and csv2tab were supported)

csvtk_linux_amd64.tar.gz

shenwei356 commented 1 year ago

near all commands skip empty files now.