Hi,
I have a duplicated observation on the column on which I would like to do a merge.
So I would like to loop over the rows and replace the first occurrence by adding a "rev_" prefix, and the exit the loop.
Here is the code I wrote, it replaces both the occurrences. Can you help with this?
Thanks
I have a duplicated observation on the column on which I would like to do a merge.
So I would like to loop over the rows and replace the first occurrence by adding a "rev_" prefix, and the exit the loop.
Here is the code I wrote, it replaces both the occurrences. Can you help with this?
Code:
foreach var of varlist _all { replace `var' = "rev_string" if strmatch(`var' , "string") continue, break }
Comment