<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Separating string copied directly from data table using Words() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451808#M69852</link>
    <description>&lt;P&gt;You seem to have \!n instead of \!N.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me it seems to work fine with this example (using Windows and JMP16).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1642323918193.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39037iAB292AF93C25813F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1642323918193.png" alt="jthi_0-1642323918193.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1642323923109.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39038i28C4306D7D8832FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1642323923109.png" alt="jthi_1-1642323923109.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("a",
	teb = Text Edit Box("", &amp;lt;&amp;lt; Set N Lines(20))
);

//paste values to teb...
//get values
teb_values = teb &amp;lt;&amp;lt; get text;
teb_as_list = Words(teb_values, "\!N");
Show(teb_as_list);
//{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA",
//"ALICE", "SUSAN", "JOHN", "JOE", "MICHAEL"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also copy-pasting from JMP datatable to Notepad++ with "View all characters" enabled, CR (Carrier Return) and LF (Line Feed) seem to be added at the end of row/line:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1642323947334.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39039iF260655DFB519ADB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1642323947334.png" alt="jthi_2-1642323947334.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Jan 2022 09:07:28 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-01-16T09:07:28Z</dc:date>
    <item>
      <title>Separating string copied directly from data table using Words()</title>
      <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451796#M69851</link>
      <description>&lt;P&gt;To use a script I'm currently working on, I need to copy-paste a set of cells from a data-table column (multiple rows, one column) into a text edit box (this step is done by the user), and within the script, I want to store this set of character cells into a single string object and separate this string out into constituent strings using the Words() function. However, when I copy directly from the data-table to the clipboard for pasting, the resultant object, when converted to a string doesn't seem to separate cell contents by either a space " " or a newline character "\!n", which would prove problematic in effective use of the Words() function to separate it out. For example, such a set of cells directly copy-pasted from a data table into the text box would look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-01-16 at 12.52.25 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39034iC19935B7952977C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-01-16 at 12.52.25 AM.png" alt="Screen Shot 2022-01-16 at 12.52.25 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And my code within the script to get this set string object into multiple strings currently looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-01-16 at 12.56.32 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39036i79E23A7174491671/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-01-16 at 12.56.32 AM.png" alt="Screen Shot 2022-01-16 at 12.56.32 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How would I go about accomplishing this? Thanks everyone.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:42:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451796#M69851</guid>
      <dc:creator>akfence</dc:creator>
      <dc:date>2023-06-10T23:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Separating string copied directly from data table using Words()</title>
      <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451808#M69852</link>
      <description>&lt;P&gt;You seem to have \!n instead of \!N.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me it seems to work fine with this example (using Windows and JMP16).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1642323918193.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39037iAB292AF93C25813F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1642323918193.png" alt="jthi_0-1642323918193.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1642323923109.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39038i28C4306D7D8832FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1642323923109.png" alt="jthi_1-1642323923109.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("a",
	teb = Text Edit Box("", &amp;lt;&amp;lt; Set N Lines(20))
);

//paste values to teb...
//get values
teb_values = teb &amp;lt;&amp;lt; get text;
teb_as_list = Words(teb_values, "\!N");
Show(teb_as_list);
//{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA",
//"ALICE", "SUSAN", "JOHN", "JOE", "MICHAEL"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also copy-pasting from JMP datatable to Notepad++ with "View all characters" enabled, CR (Carrier Return) and LF (Line Feed) seem to be added at the end of row/line:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1642323947334.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39039iF260655DFB519ADB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1642323947334.png" alt="jthi_2-1642323947334.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 09:07:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451808#M69852</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-16T09:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Separating string copied directly from data table using Words()</title>
      <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451841#M69857</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this. I'm using JMP 15, so the version is an issue maybe? Also, how would I specify a carrier return or line feed character in something like the Words() function? Thank you again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 18:59:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451841#M69857</guid>
      <dc:creator>akfence</dc:creator>
      <dc:date>2022-01-16T18:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Separating string copied directly from data table using Words()</title>
      <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451842#M69858</link>
      <description>&lt;P&gt;I have validated&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;findings in JMP 15.&amp;nbsp; The variable "teb_values" contains the text from the Text Edit Box(), with a carriage return, "0D" and a line feed character, "0A" between each line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running on a Windows 10 system.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 20:11:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451842#M69858</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-16T20:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Separating string copied directly from data table using Words()</title>
      <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451843#M69859</link>
      <description>&lt;P&gt;I would suggest printing all the variables with Show() to JMP's log to see what goes wrong. Also checkout &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/jsl-syntax-rules.shtml" target="_blank" rel="noopener"&gt;Escape Sequences for Quoted Strings&lt;/A&gt; , in most of the cases \!N should be enough&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 20:22:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/451843#M69859</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-16T20:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Separating string copied directly from data table using Words()</title>
      <link>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/452237#M69894</link>
      <description>&lt;P&gt;Are the users selecting rows in the table?&amp;nbsp; If so this code will yield a list without needing to parse anything.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Mimic the user selecting some rows
dt &amp;lt;&amp;lt; select where (:name == "KATIE" | :name == "JANE" | :name == "JOE");

user_rows = dt &amp;lt;&amp;lt; get selected rows();

if (nrows(user_rows) &amp;gt; 0,
	name_list = dt:name[user_rows];
	show(name_list);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jan 2022 21:16:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Separating-string-copied-directly-from-data-table-using-Words/m-p/452237#M69894</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2022-01-18T21:16:23Z</dc:date>
    </item>
  </channel>
</rss>

