cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
lala
Level VIII

How can replace a specified literal with a newline or TAB with a regular substitution method?

a="AB</>CDEFG<->HIJK</>LMNOP<->QRSTU</>VWXYZ"

 


Regular methods are not used.
Replace </> with a TAB.
Replace <-> with a newline character.

 

 

This writes the contents of a to the table.Thanks!

 

2020-04-22_18-13.png

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: How can replace a specified literal with a newline or TAB with a regular substitution method?

In JMP you can specify a newline and tab like this:

newline = "\!n";
tab = "\!t";
a = evalinsert("Hello World^tab^Again^newline^Fubar^tab^Again");

Use the substitute command to replace your character strings with newline or tab.

newline = "\!n";
tab = "\!t";

a = "AB</>CDEFG<->HIJK</>LMNOP<->QRSTU</>VWXYZ";
b = substitute(a, "</>", tab);
c = substitute(b, "<->", newline);

write(c);

Output:

AB	CDEFG
HIJK	LMNOP
QRSTU	VWXYZ

View solution in original post

2 REPLIES 2
pmroz
Super User

Re: How can replace a specified literal with a newline or TAB with a regular substitution method?

In JMP you can specify a newline and tab like this:

newline = "\!n";
tab = "\!t";
a = evalinsert("Hello World^tab^Again^newline^Fubar^tab^Again");

Use the substitute command to replace your character strings with newline or tab.

newline = "\!n";
tab = "\!t";

a = "AB</>CDEFG<->HIJK</>LMNOP<->QRSTU</>VWXYZ";
b = substitute(a, "</>", tab);
c = substitute(b, "<->", newline);

write(c);

Output:

AB	CDEFG
HIJK	LMNOP
QRSTU	VWXYZ
Stefan
Level III

Re: How can replace a specified literal with a newline or TAB with a regular substitution method?

@pmroz thank you...do you have any idea on how to do this when sending an email via the mail() function?

 

Cheers!