Dear Stata community,
I am struggling with a probably simple operation. I have data that contains the date and number of users holding a stock. The stock ticker however is not a variable, but part of the filename (e.g. "A.dta").
Now I want to create a ticker variable that contains the filename without the ending (e.g. "A").
Has anyone a hint on how I can achieve this?
Best regards!
PS: Ideally I want this step to be a part of a script that runs through a whole folder, as I have thousands of separate stock files.
I am struggling with a probably simple operation. I have data that contains the date and number of users holding a stock. The stock ticker however is not a variable, but part of the filename (e.g. "A.dta").
Now I want to create a ticker variable that contains the filename without the ending (e.g. "A").
Has anyone a hint on how I can achieve this?
Best regards!
PS: Ideally I want this step to be a part of a script that runs through a whole folder, as I have thousands of separate stock files.
Comment