<?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: Parse string of a column and fill another column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424014#M67323</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You beat me to it. :)&lt;/img&gt;&amp;nbsp; Your explanation is more detailed and what I was thinking of too.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 18:30:06 GMT</pubDate>
    <dc:creator>Chris_Kirchberg</dc:creator>
    <dc:date>2021-10-06T18:30:06Z</dc:date>
    <item>
      <title>Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/423985#M67320</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table containing ProductName and I want to generate the OUTPUT column.&amp;nbsp; The OUTPUT column a concatenation of ProductID with Serial#. How do I accurately parse the Serial# and create the OUTPUT column?&lt;/P&gt;&lt;P&gt;Serial # examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;07-08_13 means Serial# 07, 08, 13&lt;/LI&gt;&lt;LI&gt;09-12 means Serial# 09, 10, 11, 12&lt;/LI&gt;&lt;LI&gt;01-03_05-08 means Serial# 01, 02, 03, 05, 06, 07, 08&lt;/LI&gt;&lt;LI&gt;01_04_05-08 means Serial# 01, 04, 05, 06, 07, 08&lt;/LI&gt;&lt;LI&gt;09_11_13_14 means Serial# 09,11,13,14&lt;/LI&gt;&lt;/UL&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="cchueng_5-1633542341785.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36359i6E9EC5380E3B0E48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_5-1633542341785.png" alt="cchueng_5-1633542341785.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ProductName&lt;/TD&gt;&lt;TD&gt;OUTPUT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_07-08_13&lt;/TD&gt;&lt;TD&gt;AABBCC-07&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_07-08_13&lt;/TD&gt;&lt;TD&gt;AABBCC-08&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_07-08_13&lt;/TD&gt;&lt;TD&gt;AABBCC-13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EEFFGG_02&lt;/TD&gt;&lt;TD&gt;EEFFGG-02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-04&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-05&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HHIIJJ_01-07&lt;/TD&gt;&lt;TD&gt;HHIIJJ-07&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-05&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-07&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KKLLLMM_01-03_05-08&lt;/TD&gt;&lt;TD&gt;KKLLLMM-08&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NNOOPP_01_04_05-08&lt;/TD&gt;&lt;TD&gt;NNOOPP-01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NNOOPP_01_04_05-08&lt;/TD&gt;&lt;TD&gt;NNOOPP-04&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NNOOPP_01_04_05-08&lt;/TD&gt;&lt;TD&gt;NNOOPP-05&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NNOOPP_01_04_05-08&lt;/TD&gt;&lt;TD&gt;NNOOPP-06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NNOOPP_01_04_05-08&lt;/TD&gt;&lt;TD&gt;NNOOPP-07&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NNOOPP_01_04_05-08&lt;/TD&gt;&lt;TD&gt;NNOOPP-08&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;QQRRSS_09_11_13_14&lt;/TD&gt;&lt;TD&gt;QQRRSS_09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;QQRRSS_09_11_13_14&lt;/TD&gt;&lt;TD&gt;QQRRSS_11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;QQRRSS_09_11_13_14&lt;/TD&gt;&lt;TD&gt;QQRRSS_13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;QQRRSS_09_11_13_14&lt;/TD&gt;&lt;TD&gt;QQRRSS_14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:37:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/423985#M67320</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2023-06-10T23:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424012#M67321</link>
      <description>&lt;P&gt;Most likely you could write a formula with Lag to do that (or script with JSL), but you can also attempt to do that interactively but it takes quite a few steps:&lt;/P&gt;&lt;P&gt;1. Select ProductName column&lt;/P&gt;&lt;P&gt;2. Go to Cols/Utilities/Text To columns and use both - and _ as delimiters&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1633543923524.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36361iFC54C47833814DA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1633543923524.png" alt="jthi_1-1633543923524.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Go to Tables and Stack and add everything else besides first column to Stack Columns selection&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1633543952690.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36362i9EA441DCFF1EA0B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1633543952690.png" alt="jthi_2-1633543952690.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1633543992153.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36363iC944F3C18A5FB1DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1633543992153.png" alt="jthi_3-1633543992153.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5. Remove Label column&lt;/P&gt;&lt;P&gt;6. Select both columns which are left and go to Rows / Row Selection / Select Dublicate Rows and delete those rows&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_4-1633544046999.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36364i06FBDD424C77B6E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_4-1633544046999.png" alt="jthi_4-1633544046999.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;7. Select one cell with empty value and choose Select Matching Cells and delete those rows&lt;/P&gt;&lt;P&gt;8. Now choose both colums and right click on the column header and create formula&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_5-1633544143551.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36365iC3A6D70C648AF54A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_5-1633544143551.png" alt="jthi_5-1633544143551.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;9. Open the just created formula and change the , to _&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_6-1633544215817.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36366i1BCC3FAB9119A8F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_6-1633544215817.png" alt="jthi_6-1633544215817.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;10. Rename and delete columns/formulas&lt;/P&gt;&lt;P&gt;11. If you need to have&amp;nbsp;&lt;SPAN&gt;ProductName there, you should be able to keep it there if you don't accidentally&amp;nbsp;delete it in first step like i did&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_7-1633544489056.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36367i591A9E1422FF54E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_7-1633544489056.png" alt="jthi_7-1633544489056.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you have to have - or _ depending on the serialnumber you could handle it in the concatenate formula most likely&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit: I checked the question a bit more accurately and this is a bit more complicated than I showed here. You will have to add calculations for some of the serial numbers because they are between numbers. This solution won't work in those because some rows will be removed when duplicates&amp;nbsp;are removed.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:24:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424012#M67321</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-06T18:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424013#M67322</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10492"&gt;@cchueng&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;There are a couple of ways. Some are scripting base (look for a reply from someone suggesting this with and example) or you could use successive rounds of Text to Columns (example found here&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/How-can-I-split-text-in-a-column-into-multiple-columns/td-p/19981" target="_blank"&gt;Solved: How can I split text in a column into multiple columns? - JMP User Community)&lt;/A&gt;&amp;nbsp;Then you could concatenate the desired columns by selecting them and then either use a column formula or use the New Formula Column option after right clicking on one of the selected columns. Look for the Character options for concat.&amp;nbsp; The column formula is more flexible and gives you a lot of options see the help on this topic (&lt;A href="https://www.jmp.com/support/help/en/16.1/#page/jmp/create-formulas-in-jmp.shtml" target="_blank"&gt;Create Formulas in JMP&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;I hope that gives you some direction.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:22:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424013#M67322</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2021-10-06T18:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424014#M67323</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You beat me to it. :)&lt;/img&gt;&amp;nbsp; Your explanation is more detailed and what I was thinking of too.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:30:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424014#M67323</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2021-10-06T18:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424016#M67324</link>
      <description>&lt;P&gt;Oh, your right. the - is interpreted as a range and the _ is interpreted as a true delimiter of items&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:38:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424016#M67324</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2021-10-06T18:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424064#M67326</link>
      <description>&lt;P&gt;Thanks but I prefer a jsl rather than the interactive delimiter. Your method did not address the scenario when the Serial #&amp;nbsp;&lt;SPAN&gt;09-12. It should output rows like below. Not just AABBCC-09 and AABBCC-12. The "-" means "to" meaning range. So 09-12 means 09, 10, 11, 12.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AABBCC_09-12&lt;/TD&gt;&lt;TD&gt;AABBCC-12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 19:44:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424064#M67326</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-06T19:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424070#M67327</link>
      <description>&lt;P&gt;Ok, this might work. Requires JMP16 due to usage of For Each (can be replaced with For for other versions. This is heavily scripted solution, with little or no comments and will require specific starting table to work (needs OUTPUT column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 4993",
	Add Rows(32),
	Compress File When Saved(1),
	New Column("ProductName",
		Character,
		"Nominal",
		Set Values(
			{"AABBCC_07-08_13", "AABBCC_07-08_13", "AABBCC_07-08_13", "AABBCC_09-12", "AABBCC_09-12", "AABBCC_09-12", "AABBCC_09-12", "EEFFGG_02",
			"HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "KKLLLMM_01-03_05-08",
			"KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08",
			"NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08",
			"QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14"}
		)
	),
	New Column("OUTPUT",
		Character(16),
		"Nominal",
		Set Values({"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""})
	)
);


Summarize(dt, uniqProd = by(:ProductName));

valList = {};
For Each({prod}, uniqProd,
	prodPart = Word(1, prod, "_");
	serialPart = Substr(prod, Contains(prod, "_") + 1); //remove start
	possibleRanges = Words(serialPart, "_"); //if they contain -
	For Each({val}, possibleRanges,
		If(Contains(val, "-"), //range
			rangeVals = Words(val, "-");
			For Each({val1}, Index(Num(rangeVals[1]), Num(rangeVals[2])), 
				valToAdd = Substr("0", Length(Char(val1))) || Char(val1);
				Insert Into(valList, prodPart || "-" || valToAdd)
			);
		,
			Insert Into(valList, prodPart || "-" || Substr("0", Length(Char(val))) || Char(val))
		)
	);
);

dt[0,"OUTPUT"] = valList;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Wondering if something like this could be done "easily" with JMP's own pattern matching&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 19:47:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424070#M67327</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-06T19:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424098#M67331</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;I have a script that will address some of the ProductName and sometimes will parse wrongly. Can you review and add codes to address those ProductNames that are not working so far?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Will work for below examples :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;EEFFGG_02&lt;/P&gt;&lt;P&gt;HHIIJJ_01-07&lt;/P&gt;&lt;P&gt;KKLLLMM_01-03_05-08&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Will not work yet for below examples :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;AABBCC_07-08_13&lt;/P&gt;&lt;P&gt;NNOOPP_01_04_05-08&lt;/P&gt;&lt;P&gt;QQRRSS_09_11_13_14&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=current data table();

(dt &amp;lt;&amp;lt; New Column( "ProductID", Character )) &amp;lt;&amp;lt; Set Selected;
(dt &amp;lt;&amp;lt; New Column( "OUTPUT", Character )) &amp;lt;&amp;lt; Set Selected;
 
//Parse string in ProductName column 

For Each Row(
    dt,
    //Assign the ProductID value
    :ProductID = Word( 1, :ProductName, "_-" ); //"_"
 
    //If the ProductName changes, capture the start and end
    If( :ProductName != Lag( :ProductName, 1 ),
       
        start = Num( Word( 2, :ProductName, "_-" ) );
        end = Num( Word( 3, :ProductName, "_-" ) );
            
    );
    
  //Assign the OUTPUT value
    :OUTPUT = :ProductID || "-" || Repeat( "0", 2 - Length( Char( start ) ) ) || Char( start );
    
    //After end value &amp;amp; there is an _, set start to value after _
    If( start == end &amp;amp; Contains( :ProductName, "_"),
        start = Num( Word(-2, :ProductName, "_-" ) ),
        start++);
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 20:16:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424098#M67331</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-06T20:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424117#M67333</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;Thanks for the script but my table is actually dynamic. Each day, I will pull up this table from a database with a different date range and different sets of ProductName will appear. So it is not always 32 rows. Your script can almost work but can you address the array size? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 21:44:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424117#M67333</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-06T21:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424168#M67337</link>
      <description>&lt;P&gt;It should be fairly easy. Do you have as many rows in the pulled data as you will have serial numbers?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 08:19:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424168#M67337</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-07T08:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424977#M67420</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;Yes, the number of rows matched the number of serial numbers.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 05:22:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424977#M67420</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-09T05:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424984#M67421</link>
      <description>&lt;P&gt;If that is the case, it should already be able to handle it. I did small modifications (creation of OUTPUT column if it is missing). Currently it does rely on the fact that the datatable is sorted by ProductNames, which could cause issues at some point, or then you can make sure the input table is sorted (easiest solution).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should be able to use the For Each part can be even used without datatable as long as you have list variable named uniqProd which has ProductNames. After that is just figuring out how to add values to datatable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//Test table
/*
dt = New Table("Untitled 4993",
	Compress File When Saved(1),
	New Column("ProductName",
		Character,
		"Nominal",
		Set Values(
			{"AABBCC_07-08_13", "AABBCC_07-08_13", "AABBCC_07-08_13", "AABBCC_09-12", "AABBCC_09-12", "AABBCC_09-12", "AABBCC_09-12", "EEFFGG_02",
			"HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "KKLLLMM_01-03_05-08",
			"KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08",
			"NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08",
			"QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14"}
		)
	)
);
*/

dt = Current Data Table();

Summarize(dt, uniqProd = by(:ProductName));

valList = {};
For Each({prod}, uniqProd, //loop for each ProductName
	prodPart = Word(1, prod, "_");
	serialPart = Substr(prod, Contains(prod, "_") + 1); //remove start
	possibleRanges = Words(serialPart, "_"); //if they contain -
	For Each({val}, possibleRanges, //Loop for serialnumber inside the ProductName
		If(Contains(val, "-"), //range
			rangeVals = Words(val, "-");
			For Each({val1}, Index(Num(rangeVals[1]), Num(rangeVals[2])), 
				valToAdd = Substr("0", Length(Char(val1))) || Char(val1);
				Insert Into(valList, prodPart || "-" || valToAdd)
			);
		,
			Insert Into(valList, prodPart || "-" || Substr("0", Length(Char(val))) || Char(val))
		)
	);
);

//if starting table doesn't have OUTPUT column create it
If(!Contains(dt &amp;lt;&amp;lt; Get Column Names("String"), "OUTPUT"), 
	dt &amp;lt;&amp;lt; New Column("OUTPUT", Character, "Nominal");
);

//dt[0,"OUTPUT"] = valList; subscripting, maybe a bit more difficult to understand
dt:OUTPUT &amp;lt;&amp;lt; Set Values(valList);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simplified version what they script tries to do:&lt;/P&gt;&lt;P&gt;1. Script gets all unique values in ProductName column&lt;/P&gt;&lt;P&gt;2. Script loops over each of those in two part For Each loop&lt;/P&gt;&lt;P&gt;3. First loop loops over the unique values and splits them into Product and number parts&lt;/P&gt;&lt;P&gt;4. Serialnumber part is then looped again to split it into single values. These single values are concatenated with Product part and then the string is inserted into valList list (this 4. isn't exactly as simple as I explained here).&lt;/P&gt;&lt;P&gt;5. After both loops have finished you should have a list, which has all possible serialnumbers. Product part will be in alphabetical order.&lt;/P&gt;&lt;P&gt;6. This list is then added to OUTPUT if it exists, if it doesn't it is first created.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 07:03:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/424984#M67421</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-09T07:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425119#M67456</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;Your script will not work if my ProductName is a mixed of chars and numbers. I attached a table. This is how most of my productName will look like. Thanks for helping me out.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 17:06:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425119#M67456</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-12T17:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425120#M67457</link>
      <description>&lt;P&gt;Quickly checking there are three different issues:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Breaking the "rule" that there is always same amount of ProductNames as should be serials. N4TA59_13-19 in data only once, should be 7 times&lt;BR /&gt;2. Serial number part not starting with _ (N4PX74&lt;STRONG&gt;-&lt;/STRONG&gt;01-06)&lt;BR /&gt;3. Range not starting with _ (N4TA47_13-14-15-16-17-18) or these should be just single values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All these will require different fixes. Are these data quality issues with your data or should the script be able to handle all of these?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 05:10:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425120#M67457</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-11T05:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425156#M67464</link>
      <description>&lt;P&gt;Here is a script that produces a new table that expands the rows as requested.&amp;nbsp; By placing the data into a new table, it bypasses the issue where there are not a sufficient number of rows for the expansion.&amp;nbsp; It does appear to handle all of the known patterns.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1633945647193.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36462i7330C146A0E8AC8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1633945647193.png" alt="txnelson_0-1633945647193.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt2 = New Table( "The Output",
	New Column( "Product Name", character ),
	New Column( "ProductID", Character ),
	New Column( "OUTPUT", Character )
);

For( dtRow = 1, dtRow &amp;lt;= N Rows( dt ), dtRow++,
	If( dtRow == 1 | dt:ProductName[dtRow - 1] != dt:ProductName[dtRow],
		prodID = Word( 1, dt:ProductName[dtRow], "_" );
		remainder = Substr( dt:ProductName[dtRow], Length( prodID ) + 2 );
		While( Word( 1, remainder, "_" ) != "",
			theWord = Word( 1, remainder, "_" );
			If( Contains( theWord, "-" ),
				numDigets = Length( Word( 1, theWord, "-" ) ) - 1;
				zeros = Repeat( "0", numDigets );
				For( loop = Num( Word( 1, theWord, "-" ) ) + 1,
					loop &amp;lt;= Num( Word( 2, theWord, "-" ) ), loop++,
					dt2 &amp;lt;&amp;lt; Add rows( 1 );
					theRow = N Rows( dt2 );
					dt2:ProductName[theRow] = dt:ProductName[dtRow];
					dt2:ProductID[theRow] = Word( 1, dt:ProductName[dtRow], "_-" );
					dt2:output[theRow] = dt2:ProductID[theRow] || "-" ||
					Substr( zeros, Length( Char( loop ) ) ) || Char( loop );
				);
			,
				dt2 &amp;lt;&amp;lt; Add Rows( 1 );
				theRow = N Rows( dt2 );
				dt2:output[theRow] = prodID || "-" || Word( 1, theWord, "-" );
				dt2:ProductName[theRow] = dt:ProductName[dtRow];
				dt2:ProductID[theRow] = Word( 1, dt:ProductName[dtRow], "_-" );
			);
			remainder = Substr( remainder, Length( theWord ) + 2 );
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Oct 2021 09:47:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425156#M67464</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-10-11T09:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425362#M67475</link>
      <description>&lt;P&gt;The ProductName data are manually entered. These are exceptions and will improve over time. Please ignore them.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 15:23:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425362#M67475</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-11T15:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425561#M67502</link>
      <description>&lt;P&gt;Thanks Jim but the OUTPUT appears to be incorrect. For example the first 3 lines, the OUTPUT should be :&lt;/P&gt;&lt;P&gt;AABBCC-07&lt;/P&gt;&lt;P&gt;AABBCC-08&lt;/P&gt;&lt;P&gt;AABBCC-13&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 03:42:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425561#M67502</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-12T03:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425565#M67503</link>
      <description>&lt;P&gt;It just had a minor error where a -1 was not removed when I restructured my code.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1634012182394.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36502i28F5E8462A724A05/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1634012182394.png" alt="txnelson_0-1634012182394.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt2 = New Table( "The Output",
	New Column( "Product Name", character ),
	New Column( "ProductID", Character ),
	New Column( "OUTPUT", Character )
);

For( dtRow = 1, dtRow &amp;lt;= N Rows( dt ), dtRow++,
	If( dtRow == 1 | dt:ProductName[dtRow - 1] != dt:ProductName[dtRow],
		prodID = Word( 1, dt:ProductName[dtRow], "_" );
		remainder = Substr( dt:ProductName[dtRow], Length( prodID ) + 2 );
		While( Word( 1, remainder, "_" ) != "",
			theWord = Word( 1, remainder, "_" );
			If( Contains( theWord, "-" ),
				numDigets = Length( Word( 1, theWord, "-" ) ) - 1;
				zeros = Repeat( "0", numDigets );
				For( loop = Num( Word( 1, theWord, "-" ) ),
					loop &amp;lt;= Num( Word( 2, theWord, "-" ) ), loop++,
					dt2 &amp;lt;&amp;lt; Add rows( 1 );
					theRow = N Rows( dt2 );
					dt2:ProductName[theRow] = dt:ProductName[dtRow];
					dt2:ProductID[theRow] = Word( 1, dt:ProductName[dtRow], "_-" );
					dt2:output[theRow] = dt2:ProductID[theRow] || "-" ||
					Substr( zeros, Length( Char( loop ) ) ) || Char( loop );
				);
			,
				dt2 &amp;lt;&amp;lt; Add Rows( 1 );
				theRow = N Rows( dt2 );
				dt2:output[theRow] = prodID || "-" || Word( 1, theWord, "-" );
				dt2:ProductName[theRow] = dt:ProductName[dtRow];
				dt2:ProductID[theRow] = Word( 1, dt:ProductName[dtRow], "_-" );
			);
			remainder = Substr( remainder, Length( theWord ) + 2 );
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please make sure you take the time to study the code, so you completely understand how it is working.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 04:19:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425565#M67503</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-10-12T04:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425700#M67517</link>
      <description>&lt;P&gt;Because the data is manually entered this will most likely not handle all special cases, but seems to be working for current values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//Test table
/*
dt = New Table("Untitled 4993",
	Compress File When Saved(1),
	New Column("ProductName",
		Character,
		"Nominal",
		Set Values(
			{"AABBCC_07-08_13", "AABBCC_07-08_13", "AABBCC_07-08_13", "AABBCC_09-12", "AABBCC_09-12", "AABBCC_09-12", "AABBCC_09-12", "EEFFGG_02",
			"HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "HHIIJJ_01-07", "KKLLLMM_01-03_05-08",
			"KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08", "KKLLLMM_01-03_05-08",
			"NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08", "NNOOPP_01_04_05-08",
			"QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "QQRRSS_09_11_13_14", "N4TA47_13-14-15-16-17-18", "N4TA59_13-19", "N4PX74-01-06"}
		)
	)
);
*/

dt = Current Data Table();
Summarize(dt, uniqProd = by(:ProductName));

newVals = Associative Array();
For Each({prodname_str}, uniqProd,
	prodPart = Word(1, prodname_str, "_-");
	serialPart = Substr(prodname_str, Length(prodPart) + 2);
	//find and remove next range from serialPart
	newVals[prodname_str] = {};
	While(Length(serialPart) &amp;gt; 0 &amp;amp; serialPart != "_" &amp;amp; serialPart != "-",
		nextRange = Regex(serialPart, "\d*-\d*");
		If(IsMissing(nextRange),
			break();
		);
		serialPart = Substitute(serialPart, nextRange, "");
		If(Contains({"-", "_" }, Substr(serialPart, 1, 1)),
			serialPart = Substr(serialPart, 2); //remove -_ if first character
		);
		
		nextRange = Words(nextRange, "-");
		rangeVals = Index(Num(nextRange[1]), Num(nextRange[2]));
		For Each({val}, rangeVals,
			val = char(val);
			val = Substr("00", Length(val) + 1) || val;
			Insert Into(newVals[prodname_str], prodPart||"-"||val);
		);
	);
	singleVals = Transform Each({val}, Words(serialPart, "_"),
		val = char(val);
		val = Substr("00", Length(val) + 1) || val;
		prodPart||"-"||val;
	);
	Insert Into(newVals[prodname_str], singleVals);
);

vals = {{}, {}};
For Each({{key, value}}, newVals,
	productname_list = Repeat({key}, N Items(value));
	Insert Into(vals[1], productname_list);
	Insert Into(vals[2], Sort List(value));
);

//add values to new table
dt = New Table("Productname",
	New Column("ProductName", Character, "Nominal", Set Values({})),
	New Column("OUTPUT", Character, "Nominal", Set Values({}))
);
dt:ProductName &amp;lt;&amp;lt; Set Values(vals[1]);
dt:OUTPUT &amp;lt;&amp;lt; Set Values(vals[2]);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 15:22:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/425700#M67517</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-12T15:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Parse string of a column and fill another column</title>
      <link>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/429693#M67926</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;Can it be done such that there is no dt2? Can you add the ProductID and Output columns in dt?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 23:05:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Parse-string-of-a-column-and-fill-another-column/m-p/429693#M67926</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-10-24T23:05:35Z</dc:date>
    </item>
  </channel>
</rss>

