Dear statalists,
I am very new to Stata, and I would like to ask your help because I cannot create a loop to repeatedly open a very large dataset in smaller portions, in order to save it smaller parts, so that I could work with each separately
Suppose I have a large dataset file (dataset.dta), which I cannot open alltogether because too large for my PC. I would like to:
1) open it in the range 1/1000
2) save the file as dataset_1.dta
3) close it.
4) open 1001/2000 and restart the process until the entire dataset has been saved.
My idea was the following, but I think that it is impossible to use `i' in the range
forval i = 1/100 { use "C:\Stata\dataset.dta" in [(`i'-1)*1000+1]/(1000*`i') save "C:\Stata\dataset_`i'.dta" }
Many thanks in advance for your help, and I am sorry if it could be a silly question.
Paolo
I am very new to Stata, and I would like to ask your help because I cannot create a loop to repeatedly open a very large dataset in smaller portions, in order to save it smaller parts, so that I could work with each separately
Suppose I have a large dataset file (dataset.dta), which I cannot open alltogether because too large for my PC. I would like to:
1) open it in the range 1/1000
2) save the file as dataset_1.dta
3) close it.
4) open 1001/2000 and restart the process until the entire dataset has been saved.
My idea was the following, but I think that it is impossible to use `i' in the range
forval i = 1/100 { use "C:\Stata\dataset.dta" in [(`i'-1)*1000+1]/(1000*`i') save "C:\Stata\dataset_`i'.dta" }
Many thanks in advance for your help, and I am sorry if it could be a silly question.
Paolo
Comment