selecting cases with certain characters in middle of variable

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

selecting cases with certain characters in middle of variable

Miriam L. Gerver
I'm new to this listserv and hope that someone here can help me. I have a
dataset with over 30,000 cases and would like to select all cases that have
"@ci." in the middle of middle of the variable. (I'm dealing with email
addresses.) If there were a certain number of characters before this, I
would just split the variable and then sort it, but the number of characters
before this varies. Any ideas?

Thanks,
Miriam Gerver
Reply | Threaded
Open this post in threaded view
|

Re: selecting cases with certain characters in middle of variable

Richard Ristow
At 11:50 AM 11/8/2006, Miriam Gerver wrote:

>I would like to select all cases that have "@ci." in the middle of
>middle of the variable. If there were a certain number of characters
>before this, I would just split the variable and then sort it, but the
>number of characters before this varies.

Shouldn't be hard. I'm not testing, but if your variable is named
E_address, try this:

SELECT IF INDEX(E_Address,"@ci.") GT 0.
Reply | Threaded
Open this post in threaded view
|

Re: selecting cases with certain characters in middle of variable

Oliver, Richard
In reply to this post by Miriam L. Gerver
select if index(varname, "@ci") > 0.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Miriam Gerver
Sent: Wednesday, November 08, 2006 10:50 AM
To: [hidden email]
Subject: selecting cases with certain characters in middle of variable

I'm new to this listserv and hope that someone here can help me. I have a dataset with over 30,000 cases and would like to select all cases that have "@ci." in the middle of middle of the variable. (I'm dealing with email
addresses.) If there were a certain number of characters before this, I would just split the variable and then sort it, but the number of characters before this varies. Any ideas?

Thanks,
Miriam Gerver