cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lala
Level VII

How to make the content of the paste board into a table?

The pasted board contains previous content, blank content, and tabs at the beginning of each line, and forms a table

Thanks!



1 2023-09-09 00:00 A C 2 2023-09-09 00:00 B D
8 REPLIES 8
lala
Level VII

回复: How to make the content of the paste board into a table?

  • There may be Spaces

2023-08-10_09-11-49.png

to

2023-08-10_09-12-42.png

jthi
Super User

回复: How to make the content of the paste board into a table?

You might get quite far just by using Get Clipboard using open with blob

Names Default To Here(1);

str = Get Clipboard();
Open(Char to Blob(str), "text");

then perform cleanup in JMP table

-Jarmo
lala
Level VII

回复: How to make the content of the paste board into a table?

  • Can I make a table with multiple columns directly through regular substitution?

Thanks!

Craige_Hales
Super User

回复: How to make the content of the paste board into a table?

You can paste to a script window, clean up, and import. (You don't have to replace the tabs with commas and might not want to if the data contains commas.)

Craige
lala
Level VII

回复: How to make the content of the paste board into a table?

Can this be done with JSL?I am still using JMP14 and cannot record.

t1=Regex(txt,"\!n\!n","\!n",globalreplace);
//??

 

Thank Craige!

Craige_Hales
Super User

回复: How to make the content of the paste board into a table?

Sure, either save it to a file with a .CSV extension, or convert to a blob and open from the blob (and tell open it is a "text" file.)

Note the regex pattern uses \n for a newline and the regex replacement uses JMP's \!n.

change multiple consecutive newlines to a single newlinechange multiple consecutive newlines to a single newline

Craige
lala
Level VII

回复: How to make the content of the paste board into a table?

  • Cannot be implemented using copied data

2023-08-10_22-41-58.png

Craige_Hales
Super User

回复: How to make the content of the paste board into a table?

on line 3, try changing txt to t1

The original text is likely to have CRLF pairs, but line 2's effect is lost by line 3 overwrite.

 you can also use the Hex(t1) function to see LF==x0A and CR==x0D

Craige