Dear Stata users,
I have an excel spreadsheet with 3 sheets. Every sheet displays the date in the first column and then three price variables in the following columns. It looks the following way:
Sheet 1:
Date Price Overnight-Price Forecasted Price
2019-1 1,23 1,78 3,46
2019-2 1,44
...
...
...
2019-12 1,78
Sheet 2:
2020-1 1,79
2020-2 1,82
....
...
....
Sheet 3:
...
Now I want to append the data of sheet 3 and 2 to sheet 1 but unfortunately it is not working with my Stata code.
I tried it the following way but I do not know how to append it properly:
Thank you very much in advance!
I have an excel spreadsheet with 3 sheets. Every sheet displays the date in the first column and then three price variables in the following columns. It looks the following way:
Sheet 1:
Date Price Overnight-Price Forecasted Price
2019-1 1,23 1,78 3,46
2019-2 1,44
...
...
...
2019-12 1,78
Sheet 2:
2020-1 1,79
2020-2 1,82
....
...
....
Sheet 3:
...
Now I want to append the data of sheet 3 and 2 to sheet 1 but unfortunately it is not working with my Stata code.
I tried it the following way but I do not know how to append it properly:
Code:
forvalues i = 1(1)3 { import excel using "data.xlsx", sheet (Sheet`i') first row clear if `i' ==1 { save Data2019, replace } } else { append }
Thank you very much in advance!
Comment