[R] directory of files in a zip file?

Spencer Graves spencer.graves at prodsyse.com
Thu Jan 8 00:17:10 CET 2009


Dear Prof. Ripley: 

      Thanks very much. 

      The "getZipInfo" function in the "Rcompression" package gave me 
information on all of the files in my zip file, as you suggested. 

      Then "unzip" in the "memisc" package extracted the desired file 
and returned a character string giving the name of that temp file, which 
I could then use in "readLines" or some other function. 

      Thanks again,
      Spencer Graves

Prof Brian Ripley wrote:
> On Tue, 6 Jan 2009, Spencer Graves wrote:
>
>> Hi, All:
>>     How can I get the list of files contained in a zip file?
>>     "zip.file.extract" will extract a specific 'file' from 'zipname', 
>> but how can I get the names of the files in 'zipname'?
>
> Package Rcompression will I believe allow you to do this.  (An 
> Omegahat package, with a Windows binary on CRANextras.)  R itself does 
> not contain code to do so.
>
> Another approach is to call system("unzip ....", intern=TRUE) and 
> process the result.
>




More information about the R-help mailing list