Following link contains the files used in the video: payhip.com/b/hEt18
@lindakouekam897
3 жыл бұрын
I was stuck for more than 3 weeks with my data, but thanks to this video I was able to solve my problem easily. Let's not even talk about the possibility to contact you which is very flexible. I thank you for your precious time that you put at our disposal.
@thedatahall
3 жыл бұрын
Thanks for your kind words.
@Lily-cl6zk
2 ай бұрын
You are a great explainer thank you
@thedatahall
2 ай бұрын
Thanks. Keep sharing
@MohamadAlmalla
2 жыл бұрын
thanks for the tutorial, very useful. A questions plz: how can I skip n number of top rows in all the files?
@thedatahall
2 жыл бұрын
Use rowrange option with the same command . Rowrange allow us to give starting and ending row
@naynay7495
4 ай бұрын
I get the error "too many filenames" when running the local files : dir.. line. I have 11,000 files to combine. Any idea how to get over this error?
@thedatahall
4 ай бұрын
Thats the first time I came across this issue. Can u email me ur code and few files i will look into this (info@thedatahall.com)
@selvakumarprasad5349
Жыл бұрын
In the foreach command. The save command export the csv file to stata file with ".csv" extension instead of ".dta" Why this happened? I am still searching for this, but i cant find ans.
@thedatahall
Жыл бұрын
I guess your are using save instead of export because the only command that will save .dta file is save command. If there is still an error please share your code
@selvakumarprasad5349
Жыл бұрын
Am not using export command. I have used save command only. I found Stata save that file as ".dta" extension with the name of the file is "myfile.dta". Then when I tried to use that file, I have to call " myfile.dta.dta". Hope you understand?
@selvakumarprasad5349
Жыл бұрын
After I run the foreach loop my stata file NAME is looks like" myfile.dta." with the extension of ".dta" .
@thedatahall
Жыл бұрын
When u save file in loop, instead of "myfile.dta" just use "myfile". Because it is considering .dta as part of file name
@shadeyaakundabweni9626
Жыл бұрын
how can i get the video combining multiple datasets in stata using merge , thses one you used append
@thedatahall
Жыл бұрын
kzitem.info/news/bejne/0m5pk3tvs6WmeIo Check this video
@shadeyaakundabweni9626
Жыл бұрын
@@thedatahall is there away you can merge multiple files like more than three
@patrickferwelo54
Жыл бұрын
thank you for the info, however, the output .dta file converted into garvald. any syntax to correct? Thank you
@thedatahall
Жыл бұрын
I couldn't understand your query. You can email me at info@thedatahall.com may be with a sample file and we will look into that.
@PankajKumar-vp5ub
Жыл бұрын
I am using this code, but I am getting following error. too few quotes r(132); Kindly let me know what I am doing wrong. cd "E:\Research\try" local files : dir "E:\Research\try" files "*.csv" . . foreach file in `files' { 2. . clear 3. . import delimited `file’ 4. . save `file'.dta, replace 5. . } I am getting this error: too few quotes r(132); Kindly let me know what I am doing wrong.
@thedatahall
Жыл бұрын
save "`file'.dta", replace
@thedatahall
Жыл бұрын
With newer versions u have to use inverted commas. Let me know if the issue persists
@PankajKumar-vp5ub
Жыл бұрын
@@thedatahall yes same error is coming again after using inverted commas. cd "E:\Research\try" local files : dir "E:\Research\try" files "*.csv" foreach file in `files' { clear import delimited `file’ save "`file'.dta", replace }
@KuldeepSingh-kq9yj
2 жыл бұрын
i have two files in excel, one the data file and the other is supplementary file consists of names of villages and its code. I want to import data file into stata with names of the villages corresponding to their codes. In the data file only the codes of villages have been mentioned not the name. the solution in the video will work in this situation? can you tell me the way to do that?
@thedatahall
2 жыл бұрын
kzitem.info/news/bejne/0m5pk3tvs6WmeIo for u this video will work
@张建-p8d
2 жыл бұрын
I'm using the following command forvalues i=2001/2020 { clear import delimited BACI_HS96_1996-2020-CEPII\\ `i'.csv save tradeflows\\`i'.dta,replace } But it shows that " using required". What's wrong with my command?
@thedatahall
2 жыл бұрын
It usually is an issue of inverted commas around the i
@thedatahall
2 жыл бұрын
But still if that do not solve the issue send me few sample files and the code at info@thedatahall.com i will look into it
@mamillapallevaishnavi6759
Жыл бұрын
@@thedatahall i also have the same issue.. it says using required and everything seems right
@马丽-e8r
Жыл бұрын
//step 1: set the current directory cd "E:\Education\stata file\combining data from multiple files" //what if files names are not numbers. Then use following comand: //step 2: use following commands local files : dir "E:\Education\stata file\combining data from multiple files" files "*..csv" foreach file in `files' { clear import delimited `file’ save "`file'.dta", replace } //step 3: combine all the stata files local files: dir "E:\Education\stata file\combining data from multiple files" files "*.dta" foreach file in `files' { append using `file' } it is not work and I cannot find the merge file. I do not know why? I tried many times.
@thedatahall
Жыл бұрын
Please email me the code at info@thedatahall.com
@spreadthelightofislam1513
Жыл бұрын
I want to merge three datasets using macros and foreach loop. The file names are 1.dta, 2.dta & 3.dta I run the code in the following way: I run the following code: cd "F:\UDOY\Graduation\ECON 7th Semester_UDOY\Research Methodology\RM Class Lectures\NH Stata\Merging multiple files" use "F:\UDOY\Graduation\ECON 7th Semester_UDOY\Research Methodology\RM Class Lectures\NH Stata\Merging multiple files\1.dta" local files : dir "F:\UDOY\Graduation\ECON 7th Semester_UDOY\Research Methodology\RM Class Lectures\NH Stata\Merging multiple files" files "*.dta" foreach file in `files' { merge id using `file' } It doesn't work in this time also. It shows the following: (note: you are using old merge syntax; see [D] merge for new syntax) master data not sorted r(5);
@thedatahall
Жыл бұрын
merge syntax do have a type of merge like one to one or one to many etc, your syntax of merge is wrong. Search of our video on merge or do help merge in stata
@jawharabidi716
2 жыл бұрын
How can I adjust this code if the names of the files are not numbers ??
@thedatahall
Жыл бұрын
Pleaes contact us at info@thedatahall.com
@PankajKumar-vp5ub
Жыл бұрын
Hey, can you share code for "merging" all these files using 1:1 ?
@thedatahall
Жыл бұрын
Instead of m:1 u can use 1:1
@paulblades2325
2 жыл бұрын
Will this work with .txt files?
@thedatahall
2 жыл бұрын
Yes
@aashikasharma1616
2 жыл бұрын
If my files are in excel format, I should avoid using delimited?
@thedatahall
2 жыл бұрын
Yes .... The easy way is that manually import one file in stata and then convert that command into loop
@aashikasharma1616
2 жыл бұрын
@@thedatahall I am not making any mistake still it's showing file 'i'.xlsx not found 😭
@thedatahall
2 жыл бұрын
Send full code
@thedatahall
2 жыл бұрын
In above code u should write `i'.xlsx
@aashikasharma1616
2 жыл бұрын
@@thedatahall yes, yes I did the same. There is no error in command
@dataman6744
3 жыл бұрын
Nice work, do you share your dofiles?
@thedatahall
3 жыл бұрын
Sure, email me at info@thedatahall.com i will attach the do file
@CB-pk4fb
2 жыл бұрын
Hi, I am using the following code but nothing happens: cd "/Users/CB 1 2/Dropbox/NFTs Chris-Cris/Assets" forvalues i= 1 / 73 { clear import delimited `i'.csv save folder2\\`i'.dta, replace } forvalues i= 1 / 73{ append using folder2\\`i'.dta } am I doing something wrong? Thank you
Пікірлер: 50