0

Hi I have multiple zipped folders and each zipped folder contains one password protected excel spreadsheet.

#Get all the zip files
zipF = list.files(path="C:/Users/whyka/Desktop/School", pattern = "*.zip", full.names = TRUE)

#unzip all the files
ldply(.data = zipF, .fun =unzip, exdir = getwd())

I was able to extract the files but since they were password protected, the spreadsheets are blank and does not contain anything. *all of the spreadsheets contain the same password. help will be greatly appreciated

the beast
  • 3
  • 1
  • How did you read in the files? What function did you use? I assume you know the password? Are these `xls` or `xlsx` excel files? – MrFlick Oct 19 '20 at 04:24
  • Hi thanks for replying, they're CSV files, yes I do know the password. @MrFlick – the beast Oct 19 '20 at 05:31
  • So it's the zip file itself that is password protected, not the CSV file itself (a CSV file is just a plain test file, it's not specific to Excel at all). In that case, see the answers at this other question for how to open password protected zip files: https://stackoverflow.com/questions/37665451/unzip-password-protected-zip-files-in-r – MrFlick Oct 19 '20 at 05:34
  • Hi again, my work device does not allow internet connection due to security reasonings so I am not able install 7z. Are there any other ways where I am able to extract all the folders using a loop? @MrFlick – the beast Oct 19 '20 at 08:28

0 Answers0