How to remove the last character from the variable name

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

How to remove the last character from the variable name

jagadishpchary
Hi,

I have a set of variables in which the last character of the variable name is denoted by @ symbol. Now I need to delete it from all the available variables. I tried using the syntax CHAR.RINDEX in SPSS but could not get the solution. Could anyone help in writing the code either in SPSS or python.


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: How to remove the last character from the variable name

John F Hall

 

Try this crude but simple method:

 

Open Data Editor

 

Click on name to highlight whole column

 

CTRL+H to open find/replace window

 

Write @ in top space, then skip to replace all button.

 

Click on Replace all.

 

John F Hall (Mr)

[Retired academic survey researcher]

 

Email:   [hidden email] 

Website: www.surveyresearch.weebly.com

SPSS start page:  www.surveyresearch.weebly.com/1-survey-analysis-workshop

 

 

 

 

 

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of jagadishpchary
Sent: 29 July 2015 14:41
To: [hidden email]
Subject: How to remove the last character from the variable name

 

Hi,

 

I have a set of variables in which the last character of the variable name is denoted by @ symbol. Now I need to delete it from all the available variables. I tried using the syntax CHAR.RINDEX in SPSS but could not get the solution. Could anyone help in writing the code either in SPSS or python.

<http://spssx-discussion.1045642.n5.nabble.com/file/n5730312/Untitled.png>

 

Thanks

 

 

 

--

View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-remove-the-last-character-from-the-variable-name-tp5730312.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.

 

=====================

To manage your subscription to SPSSX-L, send a message to [hidden email] (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

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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