<?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: loop and concatenate in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193210#M41340</link>
    <description>&lt;P&gt;Here is one way to do what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here( 1 );
// Open a sample data table
dt = Open( "$SAMPLE_DATA/big class.jmp" );

// Get all of the character columns for concatenating
colNames = dt &amp;lt;&amp;lt; get column names(character,string);

// Build a command string that generates the JSL to create the column
theExpr = "dt &amp;lt;&amp;lt; new column( \!"concat\!", character, formula( concat(:" || colNames[1];

For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	theExpr = theExpr || ",:" || colNames[i]
);

theExpr = theExpr || ")));";

// Run the command string
Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Apr 2019 21:54:48 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-04-16T21:54:48Z</dc:date>
    <item>
      <title>loop and concatenate</title>
      <link>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193169#M41328</link>
      <description>&lt;P&gt;I need to create a new column which is a concatenate of a set of column&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just hard code the column name as below ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;new column("Code","character",&lt;BR /&gt;formula(&lt;FONT color="#0000FF"&gt;:deliver || :func_groupa || :func_groupb_h || :func_groupb_l || :micro firmware load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;|| :micro module build || :micro setup&lt;/FONT&gt;)&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, I want to create a script that can get the number of column from that input file and start concatenate the value inside (same as above)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 17:35:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193169#M41328</guid>
      <dc:creator>yanee</dc:creator>
      <dc:date>2019-04-16T17:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: loop and concatenate</title>
      <link>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193210#M41340</link>
      <description>&lt;P&gt;Here is one way to do what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here( 1 );
// Open a sample data table
dt = Open( "$SAMPLE_DATA/big class.jmp" );

// Get all of the character columns for concatenating
colNames = dt &amp;lt;&amp;lt; get column names(character,string);

// Build a command string that generates the JSL to create the column
theExpr = "dt &amp;lt;&amp;lt; new column( \!"concat\!", character, formula( concat(:" || colNames[1];

For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	theExpr = theExpr || ",:" || colNames[i]
);

theExpr = theExpr || ")));";

// Run the command string
Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Apr 2019 21:54:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193210#M41340</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-04-16T21:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: loop and concatenate</title>
      <link>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193326#M41370</link>
      <description>&lt;P&gt;Thank you so much ..&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 16:59:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-and-concatenate/m-p/193326#M41370</guid>
      <dc:creator>yanee</dc:creator>
      <dc:date>2019-04-17T16:59:10Z</dc:date>
    </item>
  </channel>
</rss>

