extract and store into a vector the numeric part of string
Posted: Thu Dec 30, 2010 7:28 am
I am Eviews7 user.
I have a group containing series names:
RES
RES1
X1
X4
X11
X100
I would like to create a (numeric) vector containing only the numeric part i.e
NA
1
1
4
11
100
When using string vector with bellow code,
scalar lmk = group3.@count
svector (lmk) varnames
for !k =1 to group3.@count
%xname=group3%2E%40seriesname%28%21k%29
%kname=%40mid%28%25xname%2C%40instr%28%25xname%2C%26quot%3BX%26quot%3B%29%2B1%29
varnames(!k) = %kname
next
I got:
RES
RES1
1
4
11
100
that can not be store as numeric vector. How can I get a numeric vector e.g.
NA
1
1
4
11
100
thanks
I have a group containing series names:
RES
RES1
X1
X4
X11
X100
I would like to create a (numeric) vector containing only the numeric part i.e
NA
1
1
4
11
100
When using string vector with bellow code,
scalar lmk = group3.@count
svector (lmk) varnames
for !k =1 to group3.@count
%xname=group3%2E%40seriesname%28%21k%29
%kname=%40mid%28%25xname%2C%40instr%28%25xname%2C%26quot%3BX%26quot%3B%29%2B1%29
varnames(!k) = %kname
next
I got:
RES
RES1
1
4
11
100
that can not be store as numeric vector. How can I get a numeric vector e.g.
NA
1
1
4
11
100
thanks