<?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: 如何用JSL将没有分行的文本按字节数拆分为多行的表格？ in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/%E5%A6%82%E4%BD%95%E7%94%A8JSL%E5%B0%86%E6%B2%A1%E6%9C%89%E5%88%86%E8%A1%8C%E7%9A%84%E6%96%87%E6%9C%AC%E6%8C%89%E5%AD%97%E8%8A%82%E6%95%B0%E6%8B%86%E5%88%86%E4%B8%BA%E5%A4%9A%E8%A1%8C%E7%9A%84%E8%A1%A8%E6%A0%BC/m-p/414370#M66347</link>
    <description>&lt;P&gt;Many was to do this and it depends a little bit how your strings look like (do they always have that long sequence of zeroes, is it always dividable with 64, how long it is).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is one maybe not so common way to do it by using Regex Match:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
txt = "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000";
splitCount = Length(txt) / 64; //amount of splits
regexPattern = repeat("(.{64})", splitCount); //create regex pattern to be used with Regex Match()
regexList = Regex Match(txt, regexPattern); //get list of splits
answer = Substr(regexList, 2); //drop first index, because it has the whole string (see scripting index for why)

//add to table
dt = New Table("test",
	New Column("test", Character, Values(answer)),
	New Column("lenght", Numeric, Continuous, &amp;lt;&amp;lt; Set Each Value(Length(:test)))
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You could also use For loop and Substr, insert extra values to string and use Words after that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;Other regex method:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

txtToSplit = "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000";
splitLength = "64";
regexPattern = "([^\n]{1,"||splitLength||"})";
replaceChar = ".";
result = Words(Regex(txtToSplit, regexPattern, "\1"||replaceChar,GLOBALREPLACE), replaceChar);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With For loop and Substr:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

txtToSplit = "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000";
splitCount = Length(txtToSplit) / 64; //amount of splits
resultList = {};

For(i = 0, i &amp;lt; splitCount, i++,
	Insert Into(resultList, Substr(txtToSplit, 1+i*64, 64));
);
show(resultList);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 01 Sep 2021 06:33:48 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-09-01T06:33:48Z</dc:date>
    <item>
      <title>如何用JSL将没有分行的文本按字节数拆分为多行的表格？</title>
      <link>https://community.jmp.com/t5/Discussions/%E5%A6%82%E4%BD%95%E7%94%A8JSL%E5%B0%86%E6%B2%A1%E6%9C%89%E5%88%86%E8%A1%8C%E7%9A%84%E6%96%87%E6%9C%AC%E6%8C%89%E5%AD%97%E8%8A%82%E6%95%B0%E6%8B%86%E5%88%86%E4%B8%BA%E5%A4%9A%E8%A1%8C%E7%9A%84%E8%A1%A8%E6%A0%BC/m-p/414349#M66346</link>
      <description>&lt;P&gt;请教专家:&lt;/P&gt;&lt;P&gt;如何用脚本将下面的文本、按每 64 个字符拆分为1行、&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;得到这样的表格&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-09-01_114831.png" style="width: 476px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35452iA2ADB00AC93C7BF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-09-01_114831.png" alt="2021-09-01_114831.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:55:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/%E5%A6%82%E4%BD%95%E7%94%A8JSL%E5%B0%86%E6%B2%A1%E6%9C%89%E5%88%86%E8%A1%8C%E7%9A%84%E6%96%87%E6%9C%AC%E6%8C%89%E5%AD%97%E8%8A%82%E6%95%B0%E6%8B%86%E5%88%86%E4%B8%BA%E5%A4%9A%E8%A1%8C%E7%9A%84%E8%A1%A8%E6%A0%BC/m-p/414349#M66346</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-06-09T19:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: 如何用JSL将没有分行的文本按字节数拆分为多行的表格？</title>
      <link>https://community.jmp.com/t5/Discussions/%E5%A6%82%E4%BD%95%E7%94%A8JSL%E5%B0%86%E6%B2%A1%E6%9C%89%E5%88%86%E8%A1%8C%E7%9A%84%E6%96%87%E6%9C%AC%E6%8C%89%E5%AD%97%E8%8A%82%E6%95%B0%E6%8B%86%E5%88%86%E4%B8%BA%E5%A4%9A%E8%A1%8C%E7%9A%84%E8%A1%A8%E6%A0%BC/m-p/414370#M66347</link>
      <description>&lt;P&gt;Many was to do this and it depends a little bit how your strings look like (do they always have that long sequence of zeroes, is it always dividable with 64, how long it is).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is one maybe not so common way to do it by using Regex Match:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
txt = "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000";
splitCount = Length(txt) / 64; //amount of splits
regexPattern = repeat("(.{64})", splitCount); //create regex pattern to be used with Regex Match()
regexList = Regex Match(txt, regexPattern); //get list of splits
answer = Substr(regexList, 2); //drop first index, because it has the whole string (see scripting index for why)

//add to table
dt = New Table("test",
	New Column("test", Character, Values(answer)),
	New Column("lenght", Numeric, Continuous, &amp;lt;&amp;lt; Set Each Value(Length(:test)))
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You could also use For loop and Substr, insert extra values to string and use Words after that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;Other regex method:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

txtToSplit = "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000";
splitLength = "64";
regexPattern = "([^\n]{1,"||splitLength||"})";
replaceChar = ".";
result = Words(Regex(txtToSplit, regexPattern, "\1"||replaceChar,GLOBALREPLACE), replaceChar);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With For loop and Substr:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

txtToSplit = "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000598A1405715D7B4433637B445CFF7A441F057B4460562A45DE04000000000000598A1905F6087B44C3357B4433F37A44A4007B44C07519455304000000000000598A1E055CFF7A44C3257B445CCF7A44F6D87A4460D10845D903000000000000";
splitCount = Length(txtToSplit) / 64; //amount of splits
resultList = {};

For(i = 0, i &amp;lt; splitCount, i++,
	Insert Into(resultList, Substr(txtToSplit, 1+i*64, 64));
);
show(resultList);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Sep 2021 06:33:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/%E5%A6%82%E4%BD%95%E7%94%A8JSL%E5%B0%86%E6%B2%A1%E6%9C%89%E5%88%86%E8%A1%8C%E7%9A%84%E6%96%87%E6%9C%AC%E6%8C%89%E5%AD%97%E8%8A%82%E6%95%B0%E6%8B%86%E5%88%86%E4%B8%BA%E5%A4%9A%E8%A1%8C%E7%9A%84%E8%A1%A8%E6%A0%BC/m-p/414370#M66347</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-09-01T06:33:48Z</dc:date>
    </item>
  </channel>
</rss>

