<?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: Colonnes in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639418#M83700</link>
    <description>&lt;P&gt;I reworked the previous script to meet your new requirements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

keep = {};
delete = {};

colNameList = dt &amp;lt;&amp;lt; get column names( string );
numericNamesOnly = colNameList;
For( i = N Items( colNameList ), i &amp;gt;= 1, i--,
	colNameList[i] = Uppercase( colNameList[i] );
	If( Is Missing( Num( colNameList[i] ) ) == 1,
		numericNamesOnly[i] = ""
	);
);

While( N Items( colNameList ) &amp;gt; 0,
	If(
		Contains( colNameList[1], Uppercase( "Date début" ) ),
			found = Contains( numericNamesOnly, Word( 3, colNameList[1] ) );
			If( found &amp;gt; 0,
				Insert Into( keep, colNameList[1] );
				Insert Into( keep, numericNamesOnly[found] );
				Remove From( numericNamesOnly, found, 1 );
				Remove From( numericNamesOnly, 1, 1 );
				Remove From( colNameList, found, 1 );
				Remove From( colNameList, 1, 1 );
			,
				Insert Into( delete, colNameList[1] );
				Remove From( colNameList, 1, 1 );
				Remove From( numericNamesOnly, 1, 1 );
			);,
		Is Missing( Num( colNameList[1] ) ) == 0,
			found = Contains( colNameList, Uppercase( "DATE début " ) || colNameList[1] );
			If( found &amp;gt; 0,
				Insert Into( keep, colNameList[1] );
				Insert Into( keep, dateDebutOnly[found] );
				Remove From( numericNamesOnly, found, 1 );
				Remove From( numericNamesOnly, 1, 1 );
				Remove From( colNameList, found, 1 );
				Remove From( colNameList, 1, 1 );
			,
				Insert Into( delete, colNameList[1] );
				Remove From( colNameList, 1, 1 );
				Remove From( numericNamesOnly, 1, 1 );
			);,
		Remove From( colNameList, 1, 1 );
		Remove From( numericNamesOnly, 1, 1 );
	)
);

dt &amp;lt;&amp;lt; delete columns(delete);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It isn't pretty code, but it shows the direct way to get the job done.&lt;/P&gt;
&lt;P&gt;Note: You have an error in your sample data table.&amp;nbsp; You have a column name "Datd début 952" that needs to be changed to "Date début 952"&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 12:59:30 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-06-06T12:59:30Z</dc:date>
    <item>
      <title>Colonnes</title>
      <link>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639327#M83694</link>
      <description>&lt;DIV&gt;Bonjour à tous, je dispose d’une table de données similaire à celle la :&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hcarr01_0-1686040628205.png" style="width: 490px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53456i5EE01BD7ED6078BF/image-dimensions/490x26?v=v2" width="490" height="26" role="button" title="hcarr01_0-1686040628205.png" alt="hcarr01_0-1686040628205.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;La base de données est constitué de 2 groupes :&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;- Les dates ( «&amp;nbsp;date début...&amp;nbsp;»)&lt;/DIV&gt;&lt;DIV&gt;- Les numéros associés à des opérations&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Mon objectif est de supprimer les colonnes qui ne sont pas dans l’intersection des deux groupes de colonnes.&lt;/DIV&gt;&lt;DIV&gt;C’est à dire ici, j’aimerai supprimer automatiquement avec un script les colonnes : «&amp;nbsp;Date début 952&amp;nbsp;», «&amp;nbsp;9950&amp;nbsp;»&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Merci pour votre aide !&lt;/DIV&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:49:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639327#M83694</guid>
      <dc:creator>hcarr01</dc:creator>
      <dc:date>2023-06-11T11:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Colonnes</title>
      <link>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639418#M83700</link>
      <description>&lt;P&gt;I reworked the previous script to meet your new requirements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

keep = {};
delete = {};

colNameList = dt &amp;lt;&amp;lt; get column names( string );
numericNamesOnly = colNameList;
For( i = N Items( colNameList ), i &amp;gt;= 1, i--,
	colNameList[i] = Uppercase( colNameList[i] );
	If( Is Missing( Num( colNameList[i] ) ) == 1,
		numericNamesOnly[i] = ""
	);
);

While( N Items( colNameList ) &amp;gt; 0,
	If(
		Contains( colNameList[1], Uppercase( "Date début" ) ),
			found = Contains( numericNamesOnly, Word( 3, colNameList[1] ) );
			If( found &amp;gt; 0,
				Insert Into( keep, colNameList[1] );
				Insert Into( keep, numericNamesOnly[found] );
				Remove From( numericNamesOnly, found, 1 );
				Remove From( numericNamesOnly, 1, 1 );
				Remove From( colNameList, found, 1 );
				Remove From( colNameList, 1, 1 );
			,
				Insert Into( delete, colNameList[1] );
				Remove From( colNameList, 1, 1 );
				Remove From( numericNamesOnly, 1, 1 );
			);,
		Is Missing( Num( colNameList[1] ) ) == 0,
			found = Contains( colNameList, Uppercase( "DATE début " ) || colNameList[1] );
			If( found &amp;gt; 0,
				Insert Into( keep, colNameList[1] );
				Insert Into( keep, dateDebutOnly[found] );
				Remove From( numericNamesOnly, found, 1 );
				Remove From( numericNamesOnly, 1, 1 );
				Remove From( colNameList, found, 1 );
				Remove From( colNameList, 1, 1 );
			,
				Insert Into( delete, colNameList[1] );
				Remove From( colNameList, 1, 1 );
				Remove From( numericNamesOnly, 1, 1 );
			);,
		Remove From( colNameList, 1, 1 );
		Remove From( numericNamesOnly, 1, 1 );
	)
);

dt &amp;lt;&amp;lt; delete columns(delete);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It isn't pretty code, but it shows the direct way to get the job done.&lt;/P&gt;
&lt;P&gt;Note: You have an error in your sample data table.&amp;nbsp; You have a column name "Datd début 952" that needs to be changed to "Date début 952"&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 12:59:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639418#M83700</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-06T12:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Colonnes</title>
      <link>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639492#M83706</link>
      <description>&lt;DIV&gt;Merci cela fonctionne !&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;J’ai essayé de reprendre votre script mais au départ je savais pas comment caractériser toutes les colonnes du deuxième groupe car il n’y a pas de termes similaires.&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Jun 2023 14:21:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Colonnes/m-p/639492#M83706</guid>
      <dc:creator>hcarr01</dc:creator>
      <dc:date>2023-06-06T14:21:08Z</dc:date>
    </item>
  </channel>
</rss>

