| Date: | Wed, 24 Jul 2002 07:33:14 -0400 |
| Reply-To: | Raynald Levesque <rlevesque@videotron.ca> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | Raynald Levesque <rlevesque@videotron.ca> |
| Subject: | Re: identify substring |
| In-Reply-To: | <026701c232f1$86fdead0$64e96081@ssl.flinders.edu.au> |
| Content-Type: | text/plain; charset="iso-8859-1" |
Hi
I do not have the time to finish it but this gives you the position of the
first digit.
DATA LIST FIXED /str1 1-25 (A).
BEGIN DATA
Bloggs J 10 Smith St
Bloggs John 10 Smith St
END DATA.
LIST.
VECTOR nb(25F1).
LOOP cnt=1 TO 25.
COMPUTE nb(cnt)=cnt*(1-NMISS(NUMBER(SUBSTR(str1,cnt,cnt),F1))).
END LOOP.
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Lisel O'Dwyer
Sent: July 24, 2002 5:07 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: identify substring
Hi all
I'm still working with names and addresses (aargh!)
Now I need to find the name part of a string consisting of name and address.
eg "Bloggs J 10 Smith St"
needs to be two variables, "Bloggs J" and "10 Smith St".
The obvious answer is to use the location of the first numeric character to
split the string (create a substring from position 1 to -1 position of
numeric.
But I'm having trouble actually working out the syntax for it!
Any ideas? Thanks!
Liel
Dr Lisel O'Dwyer
School of Geography, Population and Environmental Management
Flinders University
GPO Box 2100
Adelaide, South Australia 5001
http://www.ssn.flinders.edu.au/geog/staff/odwyer.htm
IAG home page: http://www.ssn.flinders.edu.au/geog/iag/
Telephone 61 8 8201 2969
Fax 61 8 8201 3521
|