Dear Stata users,
I want to local excel files in one of my folders to make a loop over them
For simplicity, let's assume I have two files in a folder "my_dir/2020/file1.xlsx" and "my_dir/2020/file2.xlsx"
I start from the following code to local all needed files in the directory:
local files : dir "my_dir/2020" files "*.xlsx"
If I check this local by using display "`files'"
I get four saved files "_.file1.xlsx", "file1.xlsx", "_.file2.xlsx", "file2.xlsx" ""
And these two files that I get do not exist in reality: "_.file1.xlsx", "_.file2.xlsx" and I do not understand why they appear in local
However, if I use same code to local dta files everything works correctly, so my problem is with xls and xlsx files
I assume that the problem can be because I recently switched from mac to windows and do not understand some peculiarities of writing code on windows. However, I tried different variants of slashes ("/", "", or all "/" except for last one) and it didn't help
I need some help with understanding why these strange additional files are created.
Best regards,
Kira
I want to local excel files in one of my folders to make a loop over them
For simplicity, let's assume I have two files in a folder "my_dir/2020/file1.xlsx" and "my_dir/2020/file2.xlsx"
I start from the following code to local all needed files in the directory:
local files : dir "my_dir/2020" files "*.xlsx"
If I check this local by using display "`files'"
I get four saved files "_.file1.xlsx", "file1.xlsx", "_.file2.xlsx", "file2.xlsx" ""
And these two files that I get do not exist in reality: "_.file1.xlsx", "_.file2.xlsx" and I do not understand why they appear in local
However, if I use same code to local dta files everything works correctly, so my problem is with xls and xlsx files
I assume that the problem can be because I recently switched from mac to windows and do not understand some peculiarities of writing code on windows. However, I tried different variants of slashes ("/", "", or all "/" except for last one) and it didn't help
I need some help with understanding why these strange additional files are created.
Best regards,
Kira
Comment