Date: Wed, 23 Feb 2005 15:19:44 +0000
Reply-To: Josh Johnson <joshjohnson88990@yahoo.co.uk>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Josh Johnson <joshjohnson88990@yahoo.co.uk>
Subject: Re: Data Processing
In-Reply-To: <ILEILJMFJPFEFKPCAMNOOEGHGCAA.king_d@swbell.net>
Content-Type: text/plain; charset=iso-8859-1
Hi,
King Douglas just spotted an error in my ill-prepared (and manually typed) example....apologies for this, and thanks for the detection!
Unfortunately many non-numeric characters have and can appear, and not only "#" and "/".
here is the corrected (I hope) example.
Thanks again for any assistance in this!
JJ
INPUT FILE
1 35#5687/589
2 4245896354
3 12458/7#4369
4 3145215863
5 04525687458
6 5245896354
7 32/4#5875436
8 03145215863
9 57856987542536
10 14452987642536
OUTPUT FILE
1 0355687589
2 04245896354
3 .
4 03145215863
5 04525687458
6 .
7 03245875436
8 03145215863
9 .
10 .
King Douglas <king_d@swbell.net> wrote:
Josh,
I'm a bit confused by your sample output file. Perhaps it because of the
order of your rules for keeping data. Seems as though the first case case
of your output file shouldn't exist as it has only nine characters and the
eighth shouldn't exist, as it begins with 02.
Can we assume that the only non-numeric characters are "#" and "/" or are
there others?
King Douglas
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Josh Johnson
Sent: Wednesday, February 23, 2005 7:52 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Data Processing
Hi all,
I'd like to manage some 'data processing' which I usually don't run, and
would really appreciate any help.
V1 is a string variable representing telephone numbers. What I need to do
is:
a. remove any non-numeric characters.
then
b. add zero to any case which its first character is not zero.
then
c. remove any cases with a length different than 10 or 11 characters.
and last
d. keep only cases which begin with '03' or '04' .
Thanks for your assistance in any of the stages (example below)
For example
INPUT FILE
1 35#5687/58
2 4245896354
3 12458/7#4369
4 3145215863
5 04525687458
6 5245896354
7 32/4#5875436
8 02145215863
9 57856987542536
10 14452987642536
OUTPUT FILE
1 035568758
2 04245896354
3 .
4 03145215863
5 04525687458
6 .
7 03245875436
8 02145215863
9 .
10 .
---------------------------------
ALL-NEW Yahoo! Messenger - all new features - even more fun!
---------------------------------
ALL-NEW Yahoo! Messenger - all new features - even more fun!