Hi Everyone,
I am trying to import chunks of a very large file, clean, then collapse it. My problem is that my outer loop seems to be stuck on the first value, and just overwrites what was created in the previous loop. In hindisght, I should have these run such that i1 corresponds to s1. How can I fix?
Here is the start of my loop:
```
local LIST 10 20 30 40 50
forval i =1/5 {
foreach s of local LIST {
clear
di "Outer loop = " `i'
di "Inner loop = " `s'
local j = `s'+10
import delimited "F:\\SaleItems_1\SaleItems_1.csv", varnames(1) encoding(UTF-16) rowrange(`s'000001:`j'000000)
cd "F:\\WA_pt2"
save SaleItems_1_pt`i'.dta, replace
```
My issue is clearly that these aren't running parallel. How should I fix this so that i and s move 1 by 1?
Best, Josh
I am trying to import chunks of a very large file, clean, then collapse it. My problem is that my outer loop seems to be stuck on the first value, and just overwrites what was created in the previous loop. In hindisght, I should have these run such that i1 corresponds to s1. How can I fix?
Here is the start of my loop:
```
local LIST 10 20 30 40 50
forval i =1/5 {
foreach s of local LIST {
clear
di "Outer loop = " `i'
di "Inner loop = " `s'
local j = `s'+10
import delimited "F:\\SaleItems_1\SaleItems_1.csv", varnames(1) encoding(UTF-16) rowrange(`s'000001:`j'000000)
cd "F:\\WA_pt2"
save SaleItems_1_pt`i'.dta, replace
```
My issue is clearly that these aren't running parallel. How should I fix this so that i and s move 1 by 1?
Best, Josh
Comment