Hey,

I have dates according to the following dataset:


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str7 varnew1
"1980K1"
"1980K2"
"1980K3"
"1980K4"
"1981K1"
end
I need to change the abbreviation for quarter from K to Q to format these dates.

I have been using this:
Code:
 replace varnew1 = "2020Q1" if varnew1 == "2020K1"
but want to change all observations at once.

Is there some letter/symbol i can use to symbolize a unspecified character to write sometinhg like this:

Code:
 replace varnew1 = "**Q*" if varnew1 == "**K*"
Or is there another solution?

/Nils