pbnjay / grate

A Go native tabular data extraction package. Currently supports .xls, .xlsx, .csv, .tsv formats.
MIT License
136 stars 21 forks source link

unable to open password protected .xls file #21

Open bsudheer opened 1 month ago

bsudheer commented 1 month ago

unable to process password protected .xls file. How can we enhance the xls.go open function to pass password as params and use the same while reading data from workbook

pbnjay commented 1 month ago

I believe you just need a way to pass the password into the rc4 implementation at this point: https://github.com/pbnjay/grate/blob/3f8e65d74a1479a5ab13eebde36560773d518676/xls/crypto/rc4.go#L121

eg replacing the built-in default protection password with the user facing one.

if you want to do a PR let me know and we can work together on a public facing API that will work for xlsx also