cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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