string n numbers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

string n numbers

Rajeshms
Dear All,

I have a variable say for example

VARIABLE1

V121
V122
V123
124
CV125

Now, I need to delete the alphabets and I should retain only numbers like the below

VARIABLE 1

121
122
123
124
125

Is this possible ? How to get this using SPSS functions/syntax/macros or anything . Thank you in advance.


--
Regards,

Rajesh M S




Reply | Threaded
Open this post in threaded view
|

Re: string n numbers

David Marso
Administrator
SEE CHAR.INDEX and CHAR.SUBSTR functions in the FM.
Note the third parameter in CHAR.INDEX .
--
Rajeshms wrote
Dear All,

I have a variable say for example

VARIABLE1

V121
V122
V123
124
CV125

Now, I need to delete the alphabets and I should retain only numbers like
the below

VARIABLE 1

121
122
123
124
125

Is this possible ? How to get this using SPSS functions/syntax/macros or
anything . Thank you in advance.


--
Regards,

Rajesh M S
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"