<?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: How to use Regex to intercept a specified range of content into a table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540373#M76105</link>
    <description>&lt;P&gt;Many ways to handle this. Here is one idea using &lt;LI-MESSAGE title="Data table subscripting" uid="21013" url="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/m-p/21013#U21013" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&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");
dt &amp;lt;&amp;lt; Add Rows(5, at end);
dt &amp;lt;&amp;lt; Select columns({"name", "age", "sex"});
Main Menu("Copy", dt &amp;lt;&amp;lt; Get Window Title);
clipb = Get Clipboard();

txt = Trim Whitespace(clipb);
// Substitute Into(txt, " ", "\!t"); // could replace spaces with tabs
l_all = Words(txt, "\!N");

// Using \!t for demo purposes
list_of_lists = Transform Each({line}, l_all, Words(line, "\!t"));

dt_new = New Table("table",
	Add Rows(N Items(l_all))
);
dt_new &amp;lt;&amp;lt; Delete Column(1);
For(i = 1, i &amp;lt;= N Items(list_of_lists[1]), i++,
	dt_new &amp;lt;&amp;lt; New Column("col" || char(i), Character, Nominal);
);
dt_new[0,0] = list_of_lists;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 04 Sep 2022 09:14:00 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-09-04T09:14:00Z</dc:date>
    <item>
      <title>How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540344#M76098</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Assumption: The original data is obtained in the clipboard with consecutive empty lines at the end, and the rows that are not empty are not copied.&lt;BR /&gt;How to use the RE to intercept the content starting after the line containing the specified content and ending on the empty line.Copy to the new table.&lt;BR /&gt;For example: "Big Class.JMP"&lt;BR /&gt;And it says "ALFRED"&lt;BR /&gt;It get my new table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-09-04_14-13-47.png" style="width: 666px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45167iAD672AFE4EB0098F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-04_14-13-47.png" alt="2022-09-04_14-13-47.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:09:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540344#M76098</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-06-09T17:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540345#M76099</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Add Rows( 5, at end );
Wait( 0 );
Current Data Table() &amp;lt;&amp;lt; Bring Window To Front;

Main Menu( "Copy With Column Names" );
txt = Get Clipboard();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Sep 2022 06:30:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540345#M76099</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-09-04T06:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540348#M76100</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Note: The data I'm actually working with is from the clipboard.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2022 06:56:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540348#M76100</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-09-04T06:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540354#M76101</link>
      <description>&lt;P&gt;In this simple case there is no need for regex and you can just get index from the list. If more complicated comparison is needed it should be fairly easy to build a loop to go through the list&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; Add Rows(5, at end);
dt &amp;lt;&amp;lt; Select columns("name");
Main Menu("Copy With Column Names", dt &amp;lt;&amp;lt; Get Window Title);
clipb = Get Clipboard();

txt = Trim Whitespace(clipb);
l_all = Words(txt, "\!N");
break_str = "HENRY";
l_interested = Substr(l_all, Contains(l_all, break_str));

dt_new = New Table("table",
	Add Rows(N Items(l_interested)),
	New Column("col", Character, Nominal, Values(l_interested));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1662278658708.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45168i10309634F7752535/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1662278658708.png" alt="jthi_0-1662278658708.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2022 08:07:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540354#M76101</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-04T08:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540368#M76104</link>
      <description>&lt;P&gt;I Want to continue learning efficient code from the experts.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the data OBTAINED from the clipBOARD HAS 3 columns per day and is separated by Spaces, not Tabs.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-09-04_16-49-52.png" style="width: 344px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45169iD21F046F3890B194/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-04_16-49-52.png" alt="2022-09-04_16-49-52.png" /&gt;&lt;/span&gt;&lt;BR /&gt;How to modify the code to get a table with three columns like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank jthi !&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2022 08:57:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540368#M76104</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-09-04T08:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540373#M76105</link>
      <description>&lt;P&gt;Many ways to handle this. Here is one idea using &lt;LI-MESSAGE title="Data table subscripting" uid="21013" url="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/m-p/21013#U21013" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&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");
dt &amp;lt;&amp;lt; Add Rows(5, at end);
dt &amp;lt;&amp;lt; Select columns({"name", "age", "sex"});
Main Menu("Copy", dt &amp;lt;&amp;lt; Get Window Title);
clipb = Get Clipboard();

txt = Trim Whitespace(clipb);
// Substitute Into(txt, " ", "\!t"); // could replace spaces with tabs
l_all = Words(txt, "\!N");

// Using \!t for demo purposes
list_of_lists = Transform Each({line}, l_all, Words(line, "\!t"));

dt_new = New Table("table",
	Add Rows(N Items(l_all))
);
dt_new &amp;lt;&amp;lt; Delete Column(1);
For(i = 1, i &amp;lt;= N Items(list_of_lists[1]), i++,
	dt_new &amp;lt;&amp;lt; New Column("col" || char(i), Character, Nominal);
);
dt_new[0,0] = list_of_lists;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Sep 2022 09:14:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540373#M76105</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-04T09:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540374#M76106</link>
      <description>&lt;P&gt;I'm still using JMP 14&lt;BR /&gt;This code is not running.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list_of_lists = Transform Each({line}, l_all, Words(line, "\!t"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank jthi !&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2022 09:34:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540374#M76106</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-09-04T09:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540375#M76107</link>
      <description>&lt;P&gt;Change it to normal for-loop. Something like this should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list_of_lists = {};
For(i = 1, i &amp;lt;= N Items(l_all), i++,
	Insert Into(list_of_lists, Eval List({Words(l_all[i], "\!t")}))
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Sep 2022 09:53:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540375#M76107</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-04T09:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Regex to intercept a specified range of content into a table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540376#M76108</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list_of_lists = {};
For(i = 1, i &amp;lt;= 3, i++,
	Insert Into(list_of_lists, Eval List({Words(l_all, " ")}))
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Sep 2022 10:10:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Regex-to-intercept-a-specified-range-of-content-into/m-p/540376#M76108</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2022-09-04T10:10:49Z</dc:date>
    </item>
  </channel>
</rss>

