Looping over a string list when importing csvs
Posted: Mon Mar 22, 2021 3:35 pm
I would like to define a list of strings, say,
where I would use each element of the set to import differently named .csv, sort of like this,
and then run a few lines of code before exporting,
and then move onto the next country, C2, in a sequence and perform exactly the same codes up until country C10.
How can I achieve this with a for loop so that its possible to loop over my defined list of string names?
In addition, what are the commands to time this loop to see how long it took Eviews to execute the program?
Help is appreciated!
Code: Select all
countries = C1, C2, C3, ... , C10Code: Select all
import "my_path\my_file_C1.csv" ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma colhead=1 eoltype=pad badfield=NA @freq M @id id @date(date) @smpl @allCode: Select all
wfsave(type=excelxml) "my_path\results\results_C1.csv" How can I achieve this with a for loop so that its possible to loop over my defined list of string names?
In addition, what are the commands to time this loop to see how long it took Eviews to execute the program?
Help is appreciated!