cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

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!

Recommended Articles