Dear colleagues,:
I have to work with a database that contains codes that I would like to codify. In order to do that I would like to substituite the certain values inside the variable.
For example:
AD00053
zoC0151
I would like to add at the beginning the characters CL1 and afterwards substitute the letter A for 1 D for 4 and then then the numbers by order per oder numbers. This should be done with a loop, since I need to do it over and over all the observations (+200.000)
Thank you very much for your help
Related Posts with Susbtituting characters or numbers inside a variable
Command outreg2Hi. I have to put in word five different regressions. I want to unify them in an only table. How can…
Substracting the year out of a business calender dateHi everyone, In my dataset I have business calender dates in the format %tbtrdates. I'm trying to e…
how to use firm new names to replace old names in two different dataset? Code: * Example generated by -dataex-. To install: ssc install dataex clear input str65 firmNameNow…
Problem with calculating the HHI (Herfindahl-Hirschman Index)Dear Stata community, I am new to the forum and to Stata, too. I am trying to calculate the HHI (He…
Panel Data Regression StepsDear Statalist, I am new to panel data regression analysis and Stata, so forgive me if my questions…
Subscribe to:
Post Comments (Atom)
0 Response to Susbtituting characters or numbers inside a variable
Post a Comment