Dear all,

I have a set of csv files named firm1, firm2, ..., firmn. Each file contains a specific date range (for instance, firm1 may have dates from Jan 1, 2000 to Dec 31, 2015 and firm2 may have dates from Apr 1, 2008 to Dec 31, 2020) and data for four variables with the same name in each file (var1, var2, var3 and var4). I want to merge all these csv files into one with dates from Jan 1, 2000 to Dec 31, 2020 (max range), keep observations according to their dates, and for the four variables to add as termination the name of the firm (e.g., var1firm1, var1firm2, var2firm1, var2firm2 and so on).

Thanks in advance for your help.