I have a list of over a thousand .csv files named 132086 145087 156086 etc (without a clear pattern in the names)
The file path is "...\data\individuals" and the .csv files are inside the "individuals" folder (to clarify, the "..." is just to not write down my specific path but I include the full path in the command).
I tried importing them as follows:
However I get an error that says "file ...\data\individuals.csv not found"
However, when I use the same command without the loop (e.g. "import delimited "...\data\individuals\132086.csv", clear") it does work.
Could anyone help me find what I am doing wrong?
Thank you!
The file path is "...\data\individuals" and the .csv files are inside the "individuals" folder (to clarify, the "..." is just to not write down my specific path but I include the full path in the command).
I tried importing them as follows:
Code:
global individuals 132086 145087 156086 etc
foreach ind in $individuals{
import delimited "...\data\individuals\`ind'.csv", clear
save imported_`ind', replace
}
However, when I use the same command without the loop (e.g. "import delimited "...\data\individuals\132086.csv", clear") it does work.
Could anyone help me find what I am doing wrong?
Thank you!

Comment