Basically what ssc package do I have to install in order to use those functions in Stata? Or is there another way to remove leading spaces in my data?
Thanks
Thanks
clear
input str6 price_string
" 3345"
"3455 "
" 2216"
" 0000"
" "
end
strltrim(price_string)
g new_price=strltrim(price_string)
list, clean
replace new_price=strtrim(price_string)
list, clean
***********
. clear
. input str6 price_string
price_s~g
1. " 3345"
2. "3455 "
3. " 2216"
4. " 0000"
5. " "
6. end
. strltrim(price_string)
unrecognized command: strltrim
r(199);
. g new_price=strltrim(price_string)
(1 missing value generated)
. list, clean
price_~g new_pr~e
1. 3345 3345
2. 3455 3455
3. 2216 2216
4. 0000 0000
5.
. replace new_price=strtrim(price_string)
(1 real change made)
. list, clean
price_~g new_pr~e
1. 3345 3345
2. 3455 3455
3. 2216 2216
4. 0000 0000
5.
.
Comment