How to unzip several raster files zipped in multiple sub-folders to one directory at once?

33 Views Asked by At

I have data in multiple folders, each folder contains a zipped file. Each zipped file contains 6 raster files (.tiff). I want to unzip all folders at once in one directory.

I am using following code:

library(plyr)
fromdir <- list.files(path=aa,pattern='*.zip',full.names=T, recursive=TRUE)
todir=file.path('D:/Data/out')
ldply(.data=fromdir,.fun=unzip,exdir=todir)

I am able to extract subfolders, each subfolder containing 6 raster files. But instead of sub-folders, I want all raster files in one directory. How can I do that? I am doing it in R.

0

There are 0 best solutions below