Administrator
|
On Fri, Jun 9, 2017 at 12:24 PM, David Marso [via SPSSX Discussion] <[hidden email]> wrote: COMPUTE #copy = CONCAT("!",LTRIM(UPCASE(F_
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
In reply to this post by David Marso
Good call, David--assuming you meant RTRIM where you typed UTRIM. ;-)
COMPUTE #copy = CONCAT("!",LTRIM(RTRIM(UPCASE(F_EMPNAME))),"!"). I am running in UNICODE mode, which is why I did not bother with that. And Mike, when using a file with several thousand cases, I would get rid of the LIST commands. All that output is not useful. Try something like this instead: TEMPORARY. SELECT IF Flag_T100. FREQUENCIES F_EMPNAME. HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
In reply to this post by David Marso
The autorecode and eyball approach would also be simplified a little by cleaning the input string into a new variable UPCASE, and removing leading blanks.
e. this is example syntax for the "AUTORECODE and eyeball to draft RECODE approach". This probably could be generalized by using TEMPLATE within AUTORECODE. Note how the 3 and 5 come out in the new set of values. data list list /F_EmpName (a30). begin data 'apple' 'APPLES' 'Aple' 'Apple' 'APPLE' 'Applecroft School' 'Appletree Court' 'Apple' 'Apple' 'Apple' 'Apple Blossom Lodge' 'Apple Blosom Lodge' 'The Apples Medical Centre NHS' end data. dataset name mydata. autorecode F_EmpName /into F_EmpName# /print. RECODE F_EmpName# (1,2,3,4=3)(5,6=5)(ELSE=COPY) into clean_F_EmpName#. formats clean_F_EmpName# (f2). APPLY DICTIONARY from mydata /source variables = F_EmpName# /target variables= clean_F_EmpName#. execute. string clean_EmpName (a30). compute clean_EmpName = valuelabel(clean_F_EmpName#). sort cases by clean_F_EmpName# F_EmpName#. list.
Art Kendall
Social Research Consultants |
In reply to this post by Bruce Weaver
Many thanks Bruce and David - it worked for me!
Also going to try the look-up table too... thanks everybody for the great advice. |
Free forum by Nabble | Edit this page |