I have files named arq1991_1996 (for years 1991 and 1996), arq1996_2000 (for years 1996 and 2000) and arq2000_2007 (for years 2000 and 2007). In each of those files I have variables for the two years considered in their respective names. For example, for the file arq1991_1996 I have variables such as nbed1991 and nbed1996 (number of beds in 1991 and 1996), ndoc1991 and ndoc1996 (number of doctor in 1991 and 1996), etc. I would like to run similar commands for all these files considering the variables for the respective two years.
How could I do so with foreach? I would like to associate the list of substrings for files names {1991_1996, 1996_2000 and 2000_2007} to substrings of variables names {1991, 1996, 2000, 2007} where 1991_1996 should be associated to 1991 and 1996, 1996_2000 to 1996 and 2000 and 2000_2007 to 2000 and 2007.
Thank you.
How could I do so with foreach? I would like to associate the list of substrings for files names {1991_1996, 1996_2000 and 2000_2007} to substrings of variables names {1991, 1996, 2000, 2007} where 1991_1996 should be associated to 1991 and 1996, 1996_2000 to 1996 and 2000 and 2000_2007 to 2000 and 2007.
Thank you.
Comment