<?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: Delete column by scipt in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-column-by-scipt/m-p/595118#M79881</link>
    <description>&lt;P&gt;Use &amp;lt;&amp;lt; Get Column Names(String) to get list of column names and then if statement with Contains to check for the specific name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col_names = dt &amp;lt;&amp;lt; Get Column Names(String);

If(Contains(col_names, "Missing(Result)"),
	dt &amp;lt;&amp;lt; Delete Columns("Missing(Result)")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Jan 2023 17:41:12 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-01-30T17:41:12Z</dc:date>
    <item>
      <title>Delete column by scipt</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-column-by-scipt/m-p/595103#M79880</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have written a script for&amp;nbsp;deleting the column &lt;STRONG&gt;"Missing(Result)" &lt;/STRONG&gt;in the table&lt;/P&gt;&lt;P&gt;My problem is that sometimes I do not have the column &lt;STRONG&gt;"Missing(Result)"&amp;nbsp;&lt;/STRONG&gt;and I'm receiving an error at this moment.&lt;/P&gt;&lt;P&gt;Can you assist me with what I need to add to my script that will delete the column if it exists in my table.&lt;/P&gt;&lt;P&gt;And if it doesn't exist, just skip this request?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dennisbur_0-1675099605619.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49646iAF8698D8D3BBBA2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dennisbur_0-1675099605619.png" alt="Dennisbur_0-1675099605619.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; delete column (column ("Missing(Result)"));&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:39:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-column-by-scipt/m-p/595103#M79880</guid>
      <dc:creator>Dennisbur</dc:creator>
      <dc:date>2023-06-08T16:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Delete column by scipt</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-column-by-scipt/m-p/595118#M79881</link>
      <description>&lt;P&gt;Use &amp;lt;&amp;lt; Get Column Names(String) to get list of column names and then if statement with Contains to check for the specific name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col_names = dt &amp;lt;&amp;lt; Get Column Names(String);

If(Contains(col_names, "Missing(Result)"),
	dt &amp;lt;&amp;lt; Delete Columns("Missing(Result)")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jan 2023 17:41:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-column-by-scipt/m-p/595118#M79881</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-01-30T17:41:12Z</dc:date>
    </item>
  </channel>
</rss>

