From 18c1e218c6f72646268a109551f2892ae6f4bde7 Mon Sep 17 00:00:00 2001 From: Anthony Damico Date: Fri, 25 Jul 2014 16:14:54 -0400 Subject: [PATCH] ahs zip ZIP Zip --- American Housing Survey/download all microdata.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/American Housing Survey/download all microdata.R b/American Housing Survey/download all microdata.R index 98e4bdf12..f389f6393 100644 --- a/American Housing Survey/download all microdata.R +++ b/American Housing Survey/download all microdata.R @@ -127,7 +127,7 @@ for ( curdir in rev( precise.links ) ){ precise.files <- gsub('(.*) (.*)' , '\\2' , ftp.contents ) # look for exact matches, only zipped. - pfi <- gsub( '.zip' , '' , precise.files ) + pfi <- gsub( '\\.zip|\\.Zip|\\.ZIP' , '' , precise.files ) # these files match a `.zip` file zip.matches <- pfi[ duplicated( pfi ) ] @@ -212,7 +212,7 @@ for ( curdir in rev( precise.links ) ){ previous.tf <- NULL # if the file is a zipped file.. - if ( extension %in% 'zip' ){ + if ( tolower( extension ) %in% 'zip' ){ # unzip it to the temporary directory, # overwriting the single file's filepath