Login  Register

Re: Search + Replace in SPSS 20

Posted by ViAnn Beadle on Feb 21, 2012; 3:39pm
URL: http://spssx-discussion.165.s1.nabble.com/Search-Replace-in-SPSS-20-tp5502036p5502592.html

Here's what I just tried:

I selected a line that had two instances of "region".
I opened the S&R dialog.
I turned on the within selection radio button.
I specified region as the search string and region1 as the replacement
string.
I hit the replace all command button and got a message box that two
instances had been changed and asked to search again.
I dismissed it.
It does turn off the selection.

This whole S&R user interface was essentially copied from Word and Notepad.
In retrospect, an IDE approach where all found search strings are displayed
in a secondary window might have been a better approach but then some might
not like that either.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Matt Kretschmer
Sent: Tuesday, February 21, 2012 8:18 AM
To: [hidden email]
Subject: Re: Search + Replace in SPSS 20

Sure:

Search+Replacement works perfectly if I don't change the default settings.
However, at times I only need to change things in certain areas of my syntax
file, for example I have the following syntax (highly simplified).

Fre v1a v1b v1c.
Cro v1a by v1b.


I now want to have the following syntax:

Fre v2a v2b v2c.
Cro v1a by v1b.

The way to do would be to highlight the first row, hit Ctrol+H, say Replace
v1 with v2 *in selected area* and then replace all.

SPSS then tells me that it can't find search string and automatically
unselects the highlighted area (an annoying feature if I need to make more
than one change in the highlighted area).

If I then click on Replace All (no area highlighted, it will replace v1 with
v2 *in the complete syntax file*.  So it CAN find the string but somehow
highlighting it doesn't work for SPSS

Matt

=====================
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