Date: Thu, 5 Jan 2012 15:16:00 -0800
Reply-To: David Marso <david.marso@gmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: David Marso <david.marso@gmail.com>
Subject: Re: Stripping Address Field Information
In-Reply-To: <201201052226.q05KH1fl008294@waikiki.cc.uga.edu>
Content-Type: text/plain; charset=UTF-8
COMPUTE #=RINDEX(address,"#").
IF # > 0 Address=SUBSTR(address,1,#-1).
COMPUTE #=RINDEX(address,"APT").
IF # > 0 Address=SUBSTR(address,1,#-1).
LIST.
Doug Harden wrote
>
> Hi, Iâm new to the list and I would appreciate some help. Here is my
> problem. I have a file with over 2 million records. I want to modify the
> address field. I need to strip out the apartment information and leave the
> rest. It appears (though I havenât checked every record â so I am
> assuming
> that is the case for every address) that the apartment information comes
> at the end of the address. The address can be of varying length and the
> apartment information can be presented in different ways, using different
> spellings and spaces. Apartment, if included is always capitalized.
> Sometimes a # is used instead. The address is one variable and it is a
> string field.
>
> For example:
>
> 55 Oakwood Drive APT # 1400
> 2930 So 150 W #2
> 2359 Lowery Lane # 10
> 8910 Echolake Terrace APT 168
> 4105 10th Ave S APT3
> 62 N 27th ST APT A316
>
> Is there any syntax that can strip out all the apartment information?,
> APT, # and the associated numbers.
>
> Thanks. I canât think of an easier way to do this.
>
> Doug
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@.UGA (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Stripping-Address-Field-Information-tp5124076p5124161.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|