Date: Tue, 19 Apr 2005 14:17:00 +0200
Reply-To: Georg.Maubach@dpwnbc.net
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Georg Maubach <Georg.Maubach@dpwnbc.net>
Subject: Substring with INDEX and RINDEX
Content-Type: text/plain; charset="us-ascii"
Hi All,
I would like to extract the middle part of a string.
Example:
String: pred_DET_emp
Middle part of the string: DET.
The COMPUTE command COMPUTE part =
SUBSTR(case_lbl,INDEX(case_lbl,"_")+1,RINDEX(case_lbl,"_")-1) results in
"DET_emp" instead of "DET".
Can anybody help?
Best regards
Georg Maubach
Market Analyst
Deutsche Post World Net
|