Dear Stata users,
I am trying to homogenize a variable (Zip code) format.
Here is the example:
I would like to make this variable in (first) 5 characters, in other words, drop all the characters after -.
Could someone please help me dealing with this issue ?
Thank you very much in advance !
best,
AC
I am trying to homogenize a variable (Zip code) format.
Here is the example:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str20 addzip "" "" "" "" "" "" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "60191" "02865" "02865" "02865" "02865" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" "55344-2252" end
Could someone please help me dealing with this issue ?
Thank you very much in advance !
best,
AC

Comment