unzip multiple zip files into specific folders with zip files names

I have 153 zipped Landsat 8 (with *.tar.gz extension) datasets in one folder. I need to extract them into specific folders named zip files.

#set directory
aa = 'D:/Landsat/154032/Landsat8'
mypath = setwd(aa)

#list of files in the directory
fromdir = list.files(path = aa, pattern = '*.tar.gz', full.names = F)

#set the directory to save files in working directory
todir = file.path(mypath)

#extract zipped folders
ldply(.data = fromdir, fun = unzip, exdir = todir)

Problem is last code doesn't work because of it doesn't create folders with zip files names

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.