Hi,
I have 8200 files with two variables the first is the date (timestamp) and amount of people holding the specific stock (users_holding).
The problem is when I merge two files the variable "users_holding" has the same name and I would like the variable to be the same name as the name of the file.
So let's say that I would like to merge Microsoft and Apple, what I would like to do, if possible, is to change the variable "users_holding" to Microsoft and the same for Apple.
Since I am rather inexperienced with Stata I would like to ask if a foreach command that could merge all the "users_holding" variables from all the 8200 files while renaming each variable to the name of the file it is being merged from.
I do apologize if I violate any rules in regards to creating this post.
I would like to say thank you very much in advance,
Mathias Sorensen
I have 8200 files with two variables the first is the date (timestamp) and amount of people holding the specific stock (users_holding).
The problem is when I merge two files the variable "users_holding" has the same name and I would like the variable to be the same name as the name of the file.
So let's say that I would like to merge Microsoft and Apple, what I would like to do, if possible, is to change the variable "users_holding" to Microsoft and the same for Apple.
Since I am rather inexperienced with Stata I would like to ask if a foreach command that could merge all the "users_holding" variables from all the 8200 files while renaming each variable to the name of the file it is being merged from.
I do apologize if I violate any rules in regards to creating this post.
I would like to say thank you very much in advance,
Mathias Sorensen
Comment