I apologize for the possible typos, english is not my mother tongue.
I´ve been working on a loop to download and unzip files from a website but I keep getting the same response when running the commands:
file
603-Modulo01/ENAHO_Definici�nValoresMonetariosBasedeDato
> s.pdf I/O error on write
could not perform unzip
program error: code follows on the same line as close brace
r(198);
And additionally, I get the last two lines which describe a problem with closing braces, although I´ve checked out the braces and apparently they´re correctly placed (I would really appreciate an answer noticing any mistakes) ; the error still pops up.
I using stata 14 MP 64 And the codes are the following ones:
#delimit;
foreach i in 603 634{;
cd "$directorio";
mkdir "$directorio/`i'";
cd "$directorio/`i'";
#delimit;
foreach j of numlist 1/5 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo0`j'.zip `i'-Modulo0`j'.zip ;
unzipfile `i'-Modulo0`j'.zip, replace;
erase `i'-Modulo0`j'.zip;
};
#delimit cr
#delimit;
foreach k of numlist 7/9 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo0`k'.zip `i'-Modulo0`k'.zip ;
unzipfile `i'-Modulo0`k'.zip, replace;
erase `i'-Modulo0`k'.zip;
};
#delimit cr
#delimit;
foreach y of numlist 10/13 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`y'.zip `i'-Modulo`y'.zip ;
unzipfile `i'-Modulo`y'.zip, replace;
erase `i'-Modulo`y'.zip;
};
#delimit cr
#delimit;
foreach x of numlist 15/18 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`x'.zip `i'-Modulo`x'.zip ;
unzipfile `i'-Modulo`x'.zip, replace;
erase `i'-Modulo`x'.zip;
};
#delimit cr
#delimit;
foreach p of numlist 22/28 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`p'.zip `i'-Modulo`p'.zip ;
unzipfile `i'-Modulo`p'.zip, replace;
erase `i'-Modulo`p'.zip;
};
#delimit cr
#delimit;
foreach t in 34 37 77 78 84 85 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`t'.zip `i'-Modulo`t'.zip ;
unzipfile `i'-Modulo`t'.zip, replace;
erase `i'-Modulo`t'.zip;
};
#delimit cr
};
#delimit cr
Thanks in advance for your responses and possible solutions.
Related Posts with problem unzipping files stata- I/O error on write could not perform unzip
Generate a New Variable: if anyI have a variable called DocVisit that records the number of times a respondent visits a clinic. It …
Bar charts: Percent on y-axis, absolute count over each bar?Hi, I'm making a bunch of barcharts, some using graph, some using catplot, like this: Code: grap…
I am shocked that Stata may not understand variable names literallyI have this simplest dataset. var new 0 1 Then I type tab va then it should throw me an error sa…
Log transform a variableIf we try to log transform a variable in STATA, why does the result(logX value) obtained differ from…
GMM with multi-level moment conditonsHi all, I want to do a two-step GMM estimation with multi-level moment conditons (the objective fun…
Subscribe to:
Post Comments (Atom)
0 Response to problem unzipping files stata- I/O error on write could not perform unzip
Post a Comment