0

I have a zipped file containing Another folder with multiple text files

It is structured like below:

C:\DS\SUPERvised\**excerise.7z**\Data Science excercie \**Articles**\

The articles file has approximately 2000 text files

I tried the below command in R but it gives an error

DATA_DIR <- system.file("extdata/", package = "readtext")

readtext(paste0(DATA_DIR, "/C:/DS/SUPERvised/**excerise.7z**/Data Science excercie /**Articles**/*"))

I guess it is confusing with the multiple zip files anyway to resolve it such that I can read the text files in Article folder without un-compressing them locally

4

1 回答 1

1

The unzip function has a parameter (poorly named if you ask me) named "list" whose default is FALSE but if you set it to TRUE you get only the contents of the zip file:

unzip(zipfile, files = NULL, list = FALSE,  #leaving off the rest of the named arguments
于 2018-07-18T19:51:06.570 回答