Choose Language Hide Translation Bar
Highlighted
lala
Level III

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
Highlighted
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

1 REPLY 1
Highlighted
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

Article Labels

    There are no labels assigned to this post.