<?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: Can implement this substitution with an operation with a regular? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806709#M98521</link>
    <description>&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;python's&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;        for i in range(4, len(columns)):
            col = columns[i]&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 18 Oct 2024 09:16:41 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2024-10-18T09:16:41Z</dc:date>
    <item>
      <title>Can implement this substitution with an operation with a regex?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805497#M98377</link>
      <description>&lt;P&gt;For example, this file is a txt file.TAB spacing:&lt;BR /&gt;Column 2 contains, column 2 contains&lt;BR /&gt;The maximum number of rows is 5&lt;BR /&gt;Can you use regular substitution to replace rows with less than 5 such symbols to complete the cell with a total of 5 similar symbols?&lt;BR /&gt;Make up as shown in the figure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-10-15_12-01-34.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69105i814AB50C4C9D4318/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-10-15_12-01-34.png" alt="2024-10-15_12-01-34.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks Experts!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 14:06:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805497#M98377</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-15T14:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805498#M98378</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Of course, for ease of handling, the contents of column 1 can also be added according to this rule.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 04:14:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805498#M98378</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-15T04:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805520#M98380</link>
      <description>&lt;P&gt;I'm not really sure what we are trying to implement here based on your text and example provided. Could you expand on it a bit?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 04:45:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805520#M98380</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-15T04:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805561#M98386</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;A	B	C
00001	744811604804487748	1
00002	744811604411447740~744811607410407768	1▲1
00003	744811607000017746~744811607407400440~744811607611467718~744811600601460016	1▲1▲1▲1
00004	744811606810447747	1
00005	744811606400167710~744811606610607767~744811608807400040~744811401407170047	1▲1▲1▲1
00006	744811607006017776~744811606014617747~744811600606400074	1▲1▲1
00007	744811607114067714~744811607406147747~744811607704147760~744811607710174146~744811600014600011	1▲1▲1▲1▲1
00008	744811604810187746~744811606706407717~744811606607400107	1▲1▲1
00009	744811608814480014~744811608704464148~744811401101140018~744811401607480040~744811401714140017	1▲1▲1▲1▲1
00010	744811606607177767~744811606707470064~744811608610440011~711741608004176007~744811401606180041~744811401704470014	1▲1▲1▲1▲1▲1
00011	744811607401167716~744811607408417748~711047607710460644~744811607711077714	1▲1▲1▲1
00012	460144607710400044~744811607711077716~744811400601440046~744811401104410044	1▲1▲1▲1
00013	744811607814617747~410144608807046447~744811608110140017~744811400807170010	1▲1▲1▲1
00014	744811607807117717~744811607806117747~744811608610400060~744811608804087740~744811400806070014	1▲1▲1▲1▲1&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;This effect is achieved after a regular substitution:&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;Thanks Experts!&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-10-15_17-44-25.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69110iD5E2CC7365022066/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-10-15_17-44-25.png" alt="2024-10-15_17-44-25.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 09:46:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805561#M98386</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-15T09:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805571#M98394</link>
      <description>&lt;P&gt;Are we trying to add more ▲ to end of last column if there is less than five of them?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:12:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805571#M98394</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-15T12:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805576#M98396</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Yes, of course column 2 is treated by the same rules.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;For convenience, you can first replace ~ with ▲&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;I want to do it in an alternate way, not in a tabular way.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txt="……";
tx=Substitute(txt,"~","▲");ccoyy&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:26:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805576#M98396</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-15T12:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805583#M98398</link>
      <description>&lt;P&gt;Forcing yourself to use regex is in my opinion a bad idea. In this case you could for example loop line by line, replace ~ and triangles with "" on columns two and three, check how many were replaced and then add them to the end of correct "columns".&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:40:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/805583#M98398</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-15T12:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806689#M98515</link>
      <description>&lt;P&gt;It seems that python's way of handling memory arrays is flexible and simple&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-10-18_15-58-02.png" style="width: 531px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69279iA9B045A63977DCD7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-10-18_15-58-02.png" alt="2024-10-18_15-58-02.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 08:00:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806689#M98515</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-18T08:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806698#M98517</link>
      <description>&lt;P&gt;Is there a reason why you couldn't do exactly (or almost) same thing in JSL?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 08:37:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806698#M98517</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-18T08:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806703#M98518</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;In JSL I don't know how to write simply in the form of memory arrays&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;Thanks Experts!&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 18 Oct 2024 08:50:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806703#M98518</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-18T08:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806705#M98519</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = "\[A	B	C
00001	744811604804487748	1
00002	744811604411447740~744811607410407768	1▲1
00003	744811607000017746~744811607407400440~744811607611467718~744811600601460016	1▲1▲1▲1
00004	744811606810447747	1
00005	744811606400167710~744811606610607767~744811608807400040~744811401407170047	1▲1▲1▲1
00006	744811607006017776~744811606014617747~744811600606400074	1▲1▲1
00007	744811607114067714~744811607406147747~744811607704147760~744811607710174146~744811600014600011	1▲1▲1▲1▲1
00008	744811604810187746~744811606706407717~744811606607400107	1▲1▲1
00009	744811608814480014~744811608704464148~744811401101140018~744811401607480040~744811401714140017	1▲1▲1▲1▲1
00010	744811606607177767~744811606707470064~744811608610440011~711741608004176007~744811401606180041~744811401704470014	1▲1▲1▲1▲1▲1
00011	744811607401167716~744811607408417748~711047607710460644~744811607711077714	1▲1▲1▲1
00012	460144607710400044~744811607711077716~744811400601440046~744811401104410044	1▲1▲1▲1
00013	744811607814617747~410144608807046447~744811608110140017~744811400807170010	1▲1▲1▲1
00014	744811607807117717~744811607806117747~744811608610400060~744811608804087740~744811400806070014	1▲1▲1▲1▲1
]\";

lines = Words(str, "\!N");
header = Remove From(lines, 1); // skip header

maxchar = 5;
res = Transform Each({line}, lines,
	row = Words(line, "\!t");
	char_to_add = maxchar - (Length(row[2]) - Length(Substitute(row[2], "~", "")));
	
	item1 = row[1];
	item2 = row[2] || Repeat("~", char_to_add);
	item3 = row[3] || Repeat("▲", char_to_add);
	
	new_line = Eval Insert("^item1^\!t^item2^\!t^item3^");	
);

Insert Into(res, header, 1);

dt = Open(Char to blob(Concat items(res, "\!N")), "text");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1729242162433.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69281iDF547DF0B3C7F99F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1729242162433.png" alt="jthi_0-1729242162433.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Scripting Index and Scripting Guide should cover everything you need to do something like this (outside of the last line).&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 09:02:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806705#M98519</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-18T09:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806709#M98521</link>
      <description>&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;python's&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;        for i in range(4, len(columns)):
            col = columns[i]&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Oct 2024 09:16:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806709#M98521</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-18T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806720#M98523</link>
      <description>&lt;P&gt;Use For Each() and Index() in JSL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;Or just use normal For loop, just start loop from 4 and make it non-exclusive to lenght&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 09:25:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806720#M98523</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-18T09:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can implement this substitution with an operation with a regular?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806721#M98524</link>
      <description>&lt;P&gt;Thanks Experts!&lt;BR /&gt;Transposed is equivalent.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 09:29:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-implement-this-substitution-with-an-operation-with-a-regex/m-p/806721#M98524</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-10-18T09:29:26Z</dc:date>
    </item>
  </channel>
</rss>

