<?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: JSL: Copy data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45756#M26123</link>
    <description>&lt;P&gt;Another way is to subset the table with all rows and all columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dt_copy = dt &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Oct 2017 13:36:24 GMT</pubDate>
    <dc:creator>Justin_Chilton</dc:creator>
    <dc:date>2017-10-11T13:36:24Z</dc:date>
    <item>
      <title>JSL: Copy data table</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45749#M26119</link>
      <description>&lt;P&gt;This is probably really simple, but I've been through the scripting guide and I've searched the community discussions without any luck so here goes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to copy a comple data table with values, column properties and all. Is there a command for this? I tried to hack something together:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=current data table();

colNames = dt &amp;lt;&amp;lt; Get Column Names( String );

ndt = New Table("Plotting Data", /*invisible,*/);

For (i=1, i &amp;lt;= NCols(dt), i++,
	New Column(colNames[i]);
	colProps = Column(dt, colNames[i]) &amp;lt;&amp;lt; Get Column Properties;
	Column( ndt, colNames[i]) &amp;lt;&amp;lt; Add Column Properties( colProps );
);

ndt &amp;lt;&amp;lt; Add Rows(NRows(dt));
For (j=1, j &amp;lt;= NCols(dt), j++,
	colVals = Column(dt, colNames[j]) &amp;lt;&amp;lt; Get values;
	Column(ndt, colNames[j]) &amp;lt;&amp;lt; Set values( colVals );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However besides being overly complicated for something rather simple, it won't copy character data because data type is apparently not included in column properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Johan&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:57:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45749#M26119</guid>
      <dc:creator>JPKO</dc:creator>
      <dc:date>2017-10-11T12:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Copy data table</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45750#M26120</link>
      <description>BTW sorry for the invisible command that's blocked out. It's not important for my question.</description>
      <pubDate>Wed, 11 Oct 2017 12:58:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45750#M26120</guid>
      <dc:creator>JPKO</dc:creator>
      <dc:date>2017-10-11T12:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Copy data table</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45752#M26122</link>
      <description>&lt;P&gt;Here's one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Eval(dt1 &amp;lt;&amp;lt; getScript);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:17:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45752#M26122</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-10-11T13:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Copy data table</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45756#M26123</link>
      <description>&lt;P&gt;Another way is to subset the table with all rows and all columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dt_copy = dt &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:36:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/45756#M26123</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2017-10-11T13:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Copy data table</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/614932#M81481</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;we just ran into an error using the proposed solution "Eval( dt &amp;lt;&amp;lt; Get script)" while using two nested "For each row" commands.&lt;/P&gt;&lt;P&gt;Replacing this with the "dt&amp;lt;&amp;lt; Subset" made the function work. So there must be a difference between these two commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 16:05:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Copy-data-table/m-p/614932#M81481</guid>
      <dc:creator>ThomasDickel</dc:creator>
      <dc:date>2023-03-21T16:05:56Z</dc:date>
    </item>
  </channel>
</rss>

