cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Hegedus1
Level III

Search and Replace on " " (Space) does not work

Hi,

 

Objective: I would like to cleanup Column names before export into graph database.  The import prices into the graph database would be much easier if I remove the spaces in the column names.  If I go to edit>Search>Find.  In the dialog box I enter a single space character into "Find What:" and clear the text in the "Replace With:" restrict to column names.  It finds nothing and replaces nothing.  Shouldn't this work?

 

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Search and Replace on " " (Space) does not work

For me it seems to be working fine, using JMP16.2.0 Pro on Windows 10.

jthi_0-1649270355168.png

After pressing Replace, the space will be removed

 

Edit:

If you are willing to use scripting, you could use something like this (requires JMP16 due to For Each), but of course it would be good to figure out why Find and replace isn't working.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Iris.jmp");
//dt = Current Data Table();

For Each({col_name}, dt << Get Column Names("String"),
	Column(dt, col_name) << Set Name(Substitute(col_name, " ", ""));
);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Search and Replace on " " (Space) does not work

For me it seems to be working fine, using JMP16.2.0 Pro on Windows 10.

jthi_0-1649270355168.png

After pressing Replace, the space will be removed

 

Edit:

If you are willing to use scripting, you could use something like this (requires JMP16 due to For Each), but of course it would be good to figure out why Find and replace isn't working.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Iris.jmp");
//dt = Current Data Table();

For Each({col_name}, dt << Get Column Names("String"),
	Column(dt, col_name) << Set Name(Substitute(col_name, " ", ""));
);
-Jarmo
Hegedus1
Level III

Re: Search and Replace on " " (Space) does not work

I think I figured out what was going on.

 

Previously I must have done a search with multiple spaces and when I entered a single space it pulled that previous search term. Notice the extra highlight on those spaces.  When I deleted them out it worked as expected.

Hegedus1_0-1649273199874.png