<?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 for how to copy and paste columns like you can with right clikcing a column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729552#M91205</link>
    <description>&lt;P&gt;Those solutions both worked great.&amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll have to create a loop to work through my columns to get them transferred over so still not as elegant as if I had a single line item of JSL that mimicked the copy and one for the paste of the selected columns but at least I can get there now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Sun, 03 Mar 2024 19:21:02 GMT</pubDate>
    <dc:creator>shampton82</dc:creator>
    <dc:date>2024-03-03T19:21:02Z</dc:date>
    <item>
      <title>JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729436#M91191</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I was scouring the Scripting Index and I couldn't find any refence for how to script in the copy column and paste column options&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_0-1709413889899.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61753iB25C9EBC2769556E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1709413889899.png" alt="shampton82_0-1709413889899.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log will record the past portion but does not record the copy portion.&lt;/P&gt;&lt;P&gt;Looks like the paste portion is just creating a new formula with the same name and then pasting over the copied properties from the copied column (I'm trying to copy over multiple smoother formula columns from one data table to another)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Paste columns
Data Table("UBS") &amp;lt;&amp;lt; New Column("Smoother(UBS Temp)", Numeric, "Continuous", Format("Best", 12), Formula(&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So it looks like I'll have to loop through getting the column names, creating new columns in the new table, renaming them, and then copying and pasting the column properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unless anyone has a better idea (which I'm sure there will be!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 21:17:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729436#M91191</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2024-03-02T21:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729446#M91192</link>
      <description>&lt;P&gt;you can ask the column - same is possible for many more objects:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Column( "A",
	Format( "Best", 12 ),
	Formula( :weight - :height )
);

myscript = :A &amp;lt;&amp;lt; get script()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 07:59:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729446#M91192</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-03-03T07:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729456#M91193</link>
      <description>&lt;P&gt;Thanks for the suggestion&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;, probably a dumb question but what would the next step be?&amp;nbsp; I tired using paste column properties once I had gotten the script from the reference column but that did not seem to work.&amp;nbsp; Appreviate any insight into the next step!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 23:25:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729456#M91193</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2024-03-02T23:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729458#M91194</link>
      <description>&lt;P&gt;Oh - this is more complicated than I thought.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;my new table &amp;lt;&amp;lt; myscript&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;doesn't work ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So either one has to prepare the message via:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval (EvalExpr(dt &amp;lt;&amp;lt; Expr(Name Expr(myscript))))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(Substitute(Expr(dt &amp;lt;&amp;lt; _message_), Expr(_message_), Name Expr(myscript)))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or switch the current data table before executing the script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;current data table( my new table);
myscript&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Mar 2024 09:00:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729458#M91194</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-03-03T09:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729510#M91199</link>
      <description>&lt;P&gt;I prefer using Send() function instead of using &amp;lt;&amp;lt; in cases like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

newcol = dt &amp;lt;&amp;lt; New Column("ABC", Numeric, Continuous, Formula(:height * :weight));

colscript = Column(dt, "ABC") &amp;lt;&amp;lt; get script;

Eval(EvalExpr(
	Send(dt, Expr(NameExpr(colscript)))
));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use Copy/Paste column properties by scripting but I would use &amp;lt;&amp;lt; get script as it is more clear what it should do and it won't mess with clipboard&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

newcol = dt &amp;lt;&amp;lt; New Column("ABC", Numeric, Continuous, Formula(:height * :weight));
dt &amp;lt;&amp;lt; Copy Column Properties({:ABC});

dt &amp;lt;&amp;lt; New Column("ABCD");
dt &amp;lt;&amp;lt; Paste Column Properties({:ABCD});
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 15:05:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729510#M91199</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-03T15:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729541#M91201</link>
      <description>&lt;P&gt;If it's just about the formula, you could use &lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;lt; get formula&lt;/FONT&gt;&amp;nbsp; - and then use the returned expression for creating the column in the second table:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Column( "A",
	Format( "Best", 12 ),
	Formula( :weight - :height )
);
myformula =:a &amp;lt;&amp;lt; get formula;

dtnew = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
Eval(Eval Expr(dt new &amp;lt;&amp;lt; new column ("A", Formula(Expr(Name Expr(myformula))))))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Mar 2024 15:23:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729541#M91201</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-03-03T15:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729552#M91205</link>
      <description>&lt;P&gt;Those solutions both worked great.&amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll have to create a loop to work through my columns to get them transferred over so still not as elegant as if I had a single line item of JSL that mimicked the copy and one for the paste of the selected columns but at least I can get there now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 19:21:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729552#M91205</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2024-03-03T19:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729608#M91221</link>
      <description>&lt;P&gt;Copy Column Properties + Paste Column Properties can be used for multiple columns, so it could be two lines if you want to use those (I most likely wouldn't and would use &amp;lt;&amp;lt; get script and loop over the columns)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Tiretread.jmp");

dt2 = New Table("test it",
	New Column("T1", numeric, continuous),
	New Column("T2", numeric, continuous),
	New Column("T3", numeric, continuous),
	Add Rows(10)
);

dt &amp;lt;&amp;lt; Copy Column Properties({:MODULUS, :ELONG});
dt2 &amp;lt;&amp;lt; Paste Column Properties({:T1, :T3});&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 08:06:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/729608#M91221</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-04T08:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/766490#M94654</link>
      <description>&lt;P&gt;This command doesn't seem to work for String values but I can't find another way to copy and paste characters from a column. Is there a different way to do this for characters?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 18:15:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/766490#M94654</guid>
      <dc:creator>S_Boilermaker</dc:creator>
      <dc:date>2024-06-17T18:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: JSL for how to copy and paste columns like you can with right clikcing a column</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/766503#M94655</link>
      <description>&lt;P&gt;What are you trying to do? If you just wish to copy character values (not the column properties) I would use Join or datatable subscripting. Also, make sure they column you are copying the values to is Character type&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 18:56:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-for-how-to-copy-and-paste-columns-like-you-can-with-right/m-p/766503#M94655</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-17T18:56:43Z</dc:date>
    </item>
  </channel>
</rss>

