Hello everybody!
I have a string variable labelled "X", which contains a series of numerical codes (e.g., 243 563453 21, 354 44 6, 23435 67, etc.).
I would need to remove all the spaces from each of these values.
Now, I have tried the standard subinstr function:
replace X = subinstr(X, " ", "", .)
but apparently this works only in case of letters, not with numerical characters. Could you please help me? I can't find the correct code.
Many thanks!
Kodi
Related Posts with How can I remove spaces in string variable
Help with reclink: perform fuzzy matches of a variable within exact matches of another variableI am trying to perform a record linking in which I have two variables: 'cod' is a 6-digit code store…
Using a string variable as xlabel for plotsDear all, I would like to plot the weekly values of my three variables (1) amount of tests performe…
Individual fixed effects vs. school fixed effectsHi all, I am deciding between a school and year fixed effects model and an individual fixed effects…
And/or symbolIs there an and/or command in Stata? I would like to generate a variable (recoverev) that would equa…
How to remove all characters that are not part of a predefined list?How can I remove from a STRING VARIABLE all characters that are not part of a predefined list? For e…
Subscribe to:
Post Comments (Atom)
0 Response to How can I remove spaces in string variable
Post a Comment