<?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 Character from String In specific position in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/431189#M68090</link>
    <description>&lt;P&gt;Could be just some simple mistake with column references.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default To Here(1);
dt = New Table("Untitled 5",
	Add Rows(3),
	New Column("DateTime", Character, "Nominal", Set Values({"21/10/24/15:21", "21/10/24/14:21", "20/09/20/15:20"}))
);

/*
other solutions
a = "21/10/24/15:21";
//other solution with Regex
Show(Regex(a, "^(.{8})(.)(.*)$", "\1 \3"));

//using Words and Concat Items
Show(Concat Items(Words(a, "/")[1 :: 3], "/") || " " || Word(4, a, "/"));

//Using Contains to get last "/" and then Substr()
lastIdx = Contains(a, "/", -1);
Substr(a, 1, lastIdx - 1) || " " || Substr(a, lastIdx + 1);
*/

dt &amp;lt;&amp;lt; New Column("Compatible DateTime", Formula(Left(:DateTime, 8)&lt;/img&gt; || " " || Right(:DateTime, 5)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(Note that the new column won't be Numeric Continuous without some extra jsl)&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 15:37:00 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-10-28T15:37:00Z</dc:date>
    <item>
      <title>Delete Character from String In specific position</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/430913#M68062</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to create a script to remove a character from a string while ignoring the same character earlier in the string.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, from a data table I have a special DateTime of YY/MM/DD/hh:mm and wish to remove the third / (ie character 9).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LukeFarrell_0-1635382576610.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/37065iBB7343AD7E93EA3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LukeFarrell_0-1635382576610.png" alt="LukeFarrell_0-1635382576610.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luke&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:39:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/430913#M68062</guid>
      <dc:creator>LukeFarrell</dc:creator>
      <dc:date>2023-06-10T23:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Character from String In specific position</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/430919#M68063</link>
      <description>&lt;P&gt;There are many approaches. If the strings are always the same length, etc, I might use a formula column with&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Left( DateTime, 8 ) || "T" || Right( DateTime, 5 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You might want a separator like T which is used by one of the international formats, yyyy-mm-ddThh:mm.&lt;/P&gt;&lt;P&gt;If there is some variation, but maybe always the third /, I might use regex in the formula column&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Regex( DateTime, "^(\d+/\d+/\d+)/(\d+:\d+)$", "\1T\2" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;^ and $ anchor the match to the beginning and end of the DateTime string. \d+ matches 1 or more digits. The parens make groups, and the two groups are referenced with \1T\2 to build the result value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 02:24:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/430919#M68063</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-10-28T02:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Character from String In specific position</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/431024#M68077</link>
      <description>&lt;P&gt;Hello Craige, I have tried that but seem to be getting errors when trying to use it:&amp;nbsp;&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="LukeFarrell_0-1635425916641.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/37073i0E317F40960545F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LukeFarrell_0-1635425916641.png" alt="LukeFarrell_0-1635425916641.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be understanding it incorrectly as I am attempting to create a new column with the data:&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="LukeFarrell_1-1635426138418.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/37074i9BC692F4CAB57913/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LukeFarrell_1-1635426138418.png" alt="LukeFarrell_1-1635426138418.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also apologies, for some reason I was unable to send as a JLS script to required screencap&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 13:03:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/431024#M68077</guid>
      <dc:creator>LukeFarrell</dc:creator>
      <dc:date>2021-10-28T13:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Character from String In specific position</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/431189#M68090</link>
      <description>&lt;P&gt;Could be just some simple mistake with column references.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default To Here(1);
dt = New Table("Untitled 5",
	Add Rows(3),
	New Column("DateTime", Character, "Nominal", Set Values({"21/10/24/15:21", "21/10/24/14:21", "20/09/20/15:20"}))
);

/*
other solutions
a = "21/10/24/15:21";
//other solution with Regex
Show(Regex(a, "^(.{8})(.)(.*)$", "\1 \3"));

//using Words and Concat Items
Show(Concat Items(Words(a, "/")[1 :: 3], "/") || " " || Word(4, a, "/"));

//Using Contains to get last "/" and then Substr()
lastIdx = Contains(a, "/", -1);
Substr(a, 1, lastIdx - 1) || " " || Substr(a, lastIdx + 1);
*/

dt &amp;lt;&amp;lt; New Column("Compatible DateTime", Formula(Left(:DateTime, 8)&lt;/img&gt; || " " || Right(:DateTime, 5)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(Note that the new column won't be Numeric Continuous without some extra jsl)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 15:37:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Character-from-String-In-specific-position/m-p/431189#M68090</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-28T15:37:00Z</dc:date>
    </item>
  </channel>
</rss>

