<?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 How to remove leading characters (::) and ending characters (;;) from a column name in a data set in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523819#M74850</link>
    <description>&lt;P&gt;Hey, can you please give me an advice how to remove certain signs like :: at the beginning and ;; at the end of a column names, if available.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;::ColumnName;; --&amp;gt; ColumnName&lt;/P&gt;&lt;P&gt;::ColumnName::XYZ;ABC;; --&amp;gt;&amp;nbsp;ColumnName::XYZ;ABC&lt;/P&gt;&lt;P&gt;123::ColumName --&amp;gt; no change 123::ColumName&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:51:25 GMT</pubDate>
    <dc:creator>Greenhorn</dc:creator>
    <dc:date>2023-06-10T23:51:25Z</dc:date>
    <item>
      <title>How to remove leading characters (::) and ending characters (;;) from a column name in a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523819#M74850</link>
      <description>&lt;P&gt;Hey, can you please give me an advice how to remove certain signs like :: at the beginning and ;; at the end of a column names, if available.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;::ColumnName;; --&amp;gt; ColumnName&lt;/P&gt;&lt;P&gt;::ColumnName::XYZ;ABC;; --&amp;gt;&amp;nbsp;ColumnName::XYZ;ABC&lt;/P&gt;&lt;P&gt;123::ColumName --&amp;gt; no change 123::ColumName&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:51:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523819#M74850</guid>
      <dc:creator>Greenhorn</dc:creator>
      <dc:date>2023-06-10T23:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove leading characters (::) and ending characters (;;) from a column name in a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523826#M74851</link>
      <description>&lt;P&gt;Here is a simple script that will do what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

For( i = 1, i &amp;lt;= N Cols( dt ), i++,
	theName = Column( dt, i ) &amp;lt;&amp;lt; get name;
	If( Left( theName, 2 ) == "::",
		theName = Substr( theName, 3 )
	);
	If( Right( theName, 2 ) == "::",
		theName = Substr( theName, 1, Length( theName ) - 2 )
	);
	Column( dt, i ) &amp;lt;&amp;lt; set name( theName );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 12:03:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523826#M74851</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-20T12:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove leading characters (::) and ending characters (;;) from a column name in a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523889#M74852</link>
      <description>&lt;P&gt;Couple of additional options for name building&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Option1, using Starts With, Ends With and Substr
If(Starts With(col_name, "::"), 
	col_name = Substr(col_name, 3);
);
If(Ends With(col_name, ";;"), 
	col_name = Substr(col_name, 1, Length(col_name) - 2);
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Not sure if this works in all cases&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Option2, using Regex
regex_pattern = "(?:^::)(.*)(?:;;$)";

Regex(col_name, regex_pattern, "\1");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 13:32:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-leading-characters-and-ending-characters-from-a/m-p/523889#M74852</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-20T13:32:17Z</dc:date>
    </item>
  </channel>
</rss>

