<?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: Renaming Columns in a script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2555#M2555</link>
    <description>I don't know *why* it works, but if you replace OldName with expr(OldName), it works for me:&lt;BR /&gt;dt = current data table ();&lt;BR /&gt;i = 1;&lt;BR /&gt;OldName = (Column name(i));&lt;BR /&gt;newvar = Substr( expr(OldName), 4, Length(expr( OldName )) - 3 );&lt;BR /&gt;show(newvar);</description>
    <pubDate>Tue, 26 Oct 2010 23:47:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-10-26T23:47:29Z</dc:date>
    <item>
      <title>How to remove a prefix from multiple column names using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2554#M2554</link>
      <description>&lt;P&gt;Ok, I guess I don't understand the JMP documentation. Short on good examples.&lt;BR /&gt;&lt;BR /&gt;I'm trying to rename the columns in a JMP file that had columns names created with a prefix. All the column name start with "pre" and I want to strip that string from the column name.&lt;BR /&gt;&lt;BR /&gt;In a loop, I was able to get all the column names extracted and displayed with a SHOW statement. I used&lt;BR /&gt;&lt;BR /&gt; OldName = (Column name(i));&lt;BR /&gt;&lt;BR /&gt;where i is the looping variable.&lt;BR /&gt;&lt;BR /&gt;It seems like all I need to do is something like&lt;BR /&gt; substr(OldName,4,Length(OldName)-3)&lt;BR /&gt;&lt;BR /&gt;but when I use that, I get all sorts of errors. Length function doesn't work for example. &lt;BR /&gt;&lt;BR /&gt;WHAT am I doing wrong? The logic is so simple, but the JMP scripting language is killing me.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 20:39:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2554#M2554</guid>
      <dc:creator>whom</dc:creator>
      <dc:date>2017-10-06T20:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Columns in a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2555#M2555</link>
      <description>I don't know *why* it works, but if you replace OldName with expr(OldName), it works for me:&lt;BR /&gt;dt = current data table ();&lt;BR /&gt;i = 1;&lt;BR /&gt;OldName = (Column name(i));&lt;BR /&gt;newvar = Substr( expr(OldName), 4, Length(expr( OldName )) - 3 );&lt;BR /&gt;show(newvar);</description>
      <pubDate>Tue, 26 Oct 2010 23:47:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2555#M2555</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-26T23:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Columns in a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2556#M2556</link>
      <description>That worked!   Thanks!</description>
      <pubDate>Wed, 27 Oct 2010 00:49:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2556#M2556</guid>
      <dc:creator>whom</dc:creator>
      <dc:date>2010-10-27T00:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Columns in a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2557#M2557</link>
      <description>Alternatively you can use&lt;BR /&gt;&lt;BR /&gt;OldName = Char(Column name(i));&lt;BR /&gt;&lt;BR /&gt;Then you do not need the Expr() within Substr().&lt;BR /&gt;&lt;BR /&gt;The reason for not working without Char() (or expr) is that Column name() returns a name value, not a quoted string. See more in the scripting guide (under "obtaining column names" p. 121, JMP 9)&lt;BR /&gt;&lt;BR /&gt;Message was edited by: MS</description>
      <pubDate>Wed, 27 Oct 2010 07:15:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2557#M2557</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2010-10-27T07:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Columns in a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2558#M2558</link>
      <description>Or this single line solution:&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2010 11:20:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2558#M2558</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2010-10-27T11:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming Columns in a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2559#M2559</link>
      <description>Or this which uses both set and get name:&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2010 16:49:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-prefix-from-multiple-column-names-using-JSL/m-p/2559#M2559</guid>
      <dc:creator>mpb</dc:creator>
      <dc:date>2010-10-27T16:49:58Z</dc:date>
    </item>
  </channel>
</rss>

