<?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: Process many columns with for loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769014#M94936</link>
    <description>&lt;P&gt;I have other columns in the table as well. Say Column X, Column Y. I don't want these columns to be part of the processing. How do I change your line to only focus on the columns I care about.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;colList = dt &amp;lt;&amp;lt; get column names( string );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 17:00:14 GMT</pubDate>
    <dc:creator>AsymptoticCos</dc:creator>
    <dc:date>2024-06-27T17:00:14Z</dc:date>
    <item>
      <title>Process many columns with for loop</title>
      <link>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/768978#M94933</link>
      <description>&lt;P&gt;I have 100 Character columns named Column_1, Column_2,....Column_100. Each column has entries like A1, A2, ... A100. I am trying to create 200 columns from these 100 columns where each input column will create 2 output columns one output column will have the letter (A) and the other column will have the number (1,2,...). How to write this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 16:07:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/768978#M94933</guid>
      <dc:creator>AsymptoticCos</dc:creator>
      <dc:date>2024-06-27T16:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Process many columns with for loop</title>
      <link>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769002#M94935</link>
      <description>&lt;P&gt;Here is an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt =
New Table( "Example",
	Add Rows( 20 ),
	New Column( "column 1",
		Character,
		Formula( "A" || Char( Random Integer( 1, 100 ) ) )
	),
	New Column( "column 2",
		Character,
		Formula( "A" || Char( Random Integer( 1, 100 ) ) )
	)
);

colList = dt &amp;lt;&amp;lt; get column names( string );
For Each( {col}, colList,
	dt &amp;lt;&amp;lt; New Column( col || " Letter",
		character,
		set each value( Substr( As Column( col ), 1, 1 ) )
	);
	dt &amp;lt;&amp;lt; New Column( col || " Number",
		set each value( Num( Substr( As Column( col ), 2 ) ) )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1719507327010.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65663iBF36AAE7CC35C6A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1719507327010.png" alt="txnelson_0-1719507327010.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or using a For() Loop&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt =
New Table( "Example",
	Add Rows( 20 ),
	New Column( "column 1",
		Character,
		Formula( "A" || Char( Random Integer( 1, 100 ) ) )
	),
	New Column( "column 2",
		Character,
		Formula( "A" || Char( Random Integer( 1, 100 ) ) )
	)
);

colList = dt &amp;lt;&amp;lt; get column names( string );
For( i=1,i&amp;lt;= NItems(colList), i++,
	dt &amp;lt;&amp;lt; New Column( colList[i] || " Letter",
		character,
		set each value( Substr( As Column( colList[i] ), 1, 1 ) )
	);
	dt &amp;lt;&amp;lt; New Column( colList[i] || " Number",
		set each value( Num( Substr( As Column( colList[i] ), 2 ) ) )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 16:58:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769002#M94935</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-27T16:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Process many columns with for loop</title>
      <link>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769014#M94936</link>
      <description>&lt;P&gt;I have other columns in the table as well. Say Column X, Column Y. I don't want these columns to be part of the processing. How do I change your line to only focus on the columns I care about.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;colList = dt &amp;lt;&amp;lt; get column names( string );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 17:00:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769014#M94936</guid>
      <dc:creator>AsymptoticCos</dc:creator>
      <dc:date>2024-06-27T17:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Process many columns with for loop</title>
      <link>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769027#M94938</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;remove from(colList,contains(colList,"Column X"),1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please take the time to read the material under the Help=&amp;gt;JMP Help Online&amp;nbsp; in the Scripting Guide section.&amp;nbsp; Also, familiarize yourself with the Scripting Index under the Help pull down menu.&amp;nbsp; These pieces of documentation will provide you with a good background on the Scripting Language and conventions in JMP.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 17:48:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Process-many-columns-with-for-loop/m-p/769027#M94938</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-27T17:48:36Z</dc:date>
    </item>
  </channel>
</rss>

