Looping through files in a folder
Posted: Mon Feb 13, 2012 1:07 pm
Hi, I am new to eviews and am simply trying to execute a peice of code on various files. I cannot seem to figure out how to properly insert the for loop number into the wfopen statement. I can open each file on its own by writing the full pathname out so that is not my problem. I have tried to create a matrix that is filled with the value 'i' on each loop (1 to 6 in this case) and could not get that to work either. I have posted my most recent attempt. Any guidance would be greatly appreciated.
cd \\Client\E$\Database
wfcreate (wf = issue) u 3131
for !i = 1 to 6
matrix(6,1) issue_num
issue_num(!i,1) = @str(!i)
wfopen "\\Client\E$\Database\Bond" + @str(!i) + ".xlsx" '' not working
freeze(uroottest_cds_spread) cds_spread.uroot(adf,const)
freeze(uroottest_FITCH_RATE ) FITCH_RATE .uroot(adf,const)
freeze(descriptives_CDS) CDS_SPREAD.stats
freeze(descriptives_Fitch) FITCH_RATE.stats
'''save results
next
cd \\Client\E$\Database
wfcreate (wf = issue) u 3131
for !i = 1 to 6
matrix(6,1) issue_num
issue_num(!i,1) = @str(!i)
wfopen "\\Client\E$\Database\Bond" + @str(!i) + ".xlsx" '' not working
freeze(uroottest_cds_spread) cds_spread.uroot(adf,const)
freeze(uroottest_FITCH_RATE ) FITCH_RATE .uroot(adf,const)
freeze(descriptives_CDS) CDS_SPREAD.stats
freeze(descriptives_Fitch) FITCH_RATE.stats
'''save results
next