<?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 to Delete Columns Based on Column Names in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277038#M53832</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/17028"&gt;@user8421&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt;&amp;nbsp;provide you ith excellent suggestions.&amp;nbsp; Also look up the character function &lt;STRONG&gt;Starts With&lt;/STRONG&gt;(ColNameList[i], "Raw")&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2020 06:14:59 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2020-07-07T06:14:59Z</dc:date>
    <item>
      <title>JSL to Delete Columns Based on Column Names</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277033#M53828</link>
      <description>&lt;P&gt;Hi everyone!&lt;BR /&gt;&lt;BR /&gt;I am looking for a script that will pull the data table column names and if the column name starts with the word "Raw" to select and delete that column.&lt;BR /&gt;&lt;BR /&gt;My script is attached below, but it has 2 issues that I cannot resolve.&lt;BR /&gt;&lt;BR /&gt;1) The contains function only searches the column name for containing the string "Raw."&amp;nbsp; Is there a way that I can specify to only select and delete the columns that START with the string "Raw"?&lt;/P&gt;&lt;P&gt;2) I get an error for the syntax I have used for deleting the column.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table()

ColNamesList = dt &amp;lt;&amp;lt; Get Column Names;

Ncols = N Items(ColNamesList);

For(
	i=1,
	i&amp;lt;=NCols,
	i++,
	If(
		Contains(Char(ColNamesList[i]), "Raw"),
		dt &amp;lt;&amp;lt; Delete Column(:Name(Char(ColNamesList[i])))
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any help appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:15:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277033#M53828</guid>
      <dc:creator>user8421</dc:creator>
      <dc:date>2023-06-10T23:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: JSL to Delete Columns Based on Column Names</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277034#M53829</link>
      <description>Hi,&lt;BR /&gt;A couple of notes (Sorry, I don't have the time right now to provide a complete solution)&lt;BR /&gt;1) Specify the format of the output of the "Column Get Names" function as text by replacing the second line of your code with:&lt;BR /&gt;ColNamesList = dt &amp;lt;&amp;lt; Get Column Names(string); you won't need to use the statement "Char" function in your code below&lt;BR /&gt;2) When deleting an unknown number of columns, it is best to start from the last column and to progress backward:&lt;BR /&gt;For (i = NCols, i&amp;gt;=1, i--, ....&lt;BR /&gt;3) You may want to simplify your delete line of code by simply using: dt &amp;lt;&amp;lt; Delete Column (Column (i))&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;TS</description>
      <pubDate>Tue, 07 Jul 2020 04:28:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277034#M53829</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2020-07-07T04:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: JSL to Delete Columns Based on Column Names</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277038#M53832</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/17028"&gt;@user8421&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt;&amp;nbsp;provide you ith excellent suggestions.&amp;nbsp; Also look up the character function &lt;STRONG&gt;Starts With&lt;/STRONG&gt;(ColNameList[i], "Raw")&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 06:14:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-to-Delete-Columns-Based-on-Column-Names/m-p/277038#M53832</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-07-07T06:14:59Z</dc:date>
    </item>
  </channel>
</rss>

