cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar

How to separate excel "copy paste" in JMP string?

Hey,

so by copy pasting some cells from excel into a JMP data table column, the cells are perfectly split into separate rows. But if I paste the same cells into a text edit box or just in a JSL script, the cells are only separated by a "pseudo" line break. They all are in different rows but don't have a whitespace or line break or other delimiter in between. How can I separate them like JMP does it in the data table? The  values of the cells are completely random in all regards so no regex possible.

3 REPLIES 3
jthi
Super User

Re: How to separate excel "copy paste" in JMP string?

If they are on separate rows, they most likely have some sort of character between them.You can find JMP's escape sequences for strings  Scripting Guide > JSL Building Blocks > JSL Syntax Rules. 

 

What does your starting situation look like? What type of separation do you wish to achieve in the text edit box? 

-Jarmo
jthi
Super User

Re: How to separate excel "copy paste" in JMP string?

Names Default To Here(1);

nw = New Window("",
	teb = Text Edit Box("", << Set Width(300), << Set N Lines(3)),
	Button Box("Get",
		cur_txt = teb << get text;
		l = Words(cur_txt, "\!N");
		show(cur_txt, l);
	);
);

Write();

Using something simple like Words with \!N will work most of the time

jthi_0-1755531085939.png 

jthi_2-1755531199128.png

jthi_1-1755531108835.png

But if it is possible that there are cells with multi-line values, it will require extra handling. The better you know the pattern of your cells, the easier it will be to handle the values.

-Jarmo

Re: How to separate excel "copy paste" in JMP string?

So my solution was to use words() but the seperator was just the empty string with one enter press (a line break without \!n)

Recommended Articles