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
Looping through files in a folder
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Looping through files in a folder
You can't build the full file name up as part of the wfopen command. Build it up in a temporary string first then use that temp string in wfopen.
Re: Looping through files in a folder
Thanks so much for the speedy reply. Only took a few minutes to figure out exactly how to do that. Thanks again!
Who is online
Users browsing this forum: No registered users and 1 guest
