Date: Thu, 3 Jun 2004 07:48:15 -0600
Reply-To: "Jose G. Benuzillo" <jose.benuzillo@hci.utah.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Jose G. Benuzillo" <jose.benuzillo@hci.utah.edu>
Subject: Re: Syntax for string select
Content-Type: text/plain; charset="US-ASCII"
Oops, error on my part; I did not interpret the problem correctly. Jan's
solution is correct.
Jose
Jose Benuzillo, M.A.
Huntsman Cancer Institute
Cancer Control and Population Sciences
2000 Circle of Hope
Salt Lake City, UT 84112
801.585.6610
-----Original Message-----
From: Spousta Jan [mailto:JSpousta@CSAS.CZ]
Sent: Thursday, June 03, 2004 7:21 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: Syntax for string select
Hi Jeff,
try this:
data list fixed /v1 1-50 (A).
begin data.
Daschle, Tom (D-SD)
Oberstar, James L. (DFL-MN, 8th)
Boswell, Leonard L. (D-IA, 3rd)
Committee on Financial Services
Committee on Agriculture, Boston
Olver, John W. (D-MA, 1st)
Larsen, Rick (D-WA, 2nd)
end data.
string name (A20).
if (index(v1,", ")=index(v1," ")-1) name = substr(v1,1,index(v1,",
")-1).
exe.
Jan
-----Original Message-----
From: Jeff Hayes, Ph.D. [mailto:jwh_123@YAHOO.COM]
Sent: Thursday, June 03, 2004 3:00 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Syntax for string select
Hi,
Can anyone help me with the syntax for creating a new string variable
that
strips out the first word of a text string if that word ends with a
comma. So
assuming the below vector (TEXT) ...
Daschle, Tom (D-SD)
Oberstar, James L. (DFL-MN, 8th)
Boswell, Leonard L. (D-IA, 3rd)
Committee on Financial Services
Committee on Agriculture
Olver, John W. (D-MA, 1st)
Larsen, Rick (D-WA, 2nd)
The syntax would produce the below vector (NEWTEXT) ...
Daschle
Oberstar
Boswell
Oliver
Larsen
Any help is appreciated!
Cheers,
Jeff
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
Huntsman Cancer Institute wishes to promote open communication while protecting confidential and/or privileged information. If you have received this message in error, please inform the sender and delete all copies.
|