<?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: Unstacking a Stacked Excel Cell or Parsing Free-form Text to Generate Multiple Rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270789#M52711</link>
    <description>&lt;P&gt;Ha ha sounds good.&amp;nbsp; Hope to see you at Discovery 2020.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 18:47:12 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2020-06-04T18:47:12Z</dc:date>
    <item>
      <title>Unstacking a Stacked Excel Cell or Parsing Free-form Text to Generate Multiple Rows</title>
      <link>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270441#M52652</link>
      <description>&lt;P&gt;We all run into some version of this: Excel table formatted to look nice, no thought given to analyzability.&lt;/P&gt;&lt;P&gt;In the free-form text cell, it looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m/d: text [alt+enter]&lt;BR /&gt;m/d: text [alt+enter]&lt;BR /&gt;m/d: text [alt+enter]&lt;BR /&gt;m/d: text [alt+enter]&lt;BR /&gt;...&lt;BR /&gt;m/d: text [alt+enter]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the data are exported to JMP, the cell gets collapsed into:&amp;nbsp;m/d: text&amp;nbsp;m/d: text&amp;nbsp;m/d: text ...&amp;nbsp;m/d: text.&lt;BR /&gt;I want to parse that long string with n elements into a separate row for each element, not split into separate columns. n is variable. This would create a new datatable that copies the other columns and adds the parsed element. Instead of Text-to-Columns, this is Text-to-More-Rows.&lt;/P&gt;&lt;P&gt;Thankfully #/# is used consistently, so I could count those and loop n times.&lt;/P&gt;&lt;P&gt;Has anyone out there done something similar?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:14:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270441#M52652</guid>
      <dc:creator>markschahl</dc:creator>
      <dc:date>2023-06-10T23:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Unstacking a Stacked Excel Cell or Parsing Free-form Text to Generate Multiple Rows</title>
      <link>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270461#M52653</link>
      <description>&lt;P&gt;I do this sort of thing a lot; you just have to slog through it.&amp;nbsp; Here's an example where Column 1 has multiple values, and Column 2 is static.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Test", Add Rows( 3 ), Set Cell Height( 83 ),
	New Column( "Column 1", Character, "Nominal",
		Set Values(
{"5/3: ABCDE
5/4: DEF
5/5: GHI",
"5/6: xyz
5/7: foo
5/8: bar
5/9: Hello
5/10: World",
"4/16: The
4/17: Entire
4/18: Scheme
4/19: Of
4/20: Things
4/21: Is broken"} ),
		Set Display Width( 156 )
	),
	New Column( "Column 2", Character, "Nominal", Set Values( {"A", "B", "C"} ) )
);

dtnew = new table("Text_to_Rows",
	new column("Column 1", Character, "Nominal"),
	new column("Column 2", Character, "Nominal"),
);

delim = "
";
m = 0;
for (i = 1, i &amp;lt;= nrows(dt), i++,
	c1_words = words(dt:column 1[i], delim);
	one_c2   = dt:column 2[i];

	for (k = 1, k &amp;lt;= nitems(c1_words), k++,
		dtnew &amp;lt;&amp;lt; add rows(1);
		m++;
		dtnew:Column 1[m] = c1_words[k];
		dtnew:Column 2[m] = one_c2;
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 16:04:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270461#M52653</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-06-03T16:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unstacking a Stacked Excel Cell or Parsing Free-form Text to Generate Multiple Rows</title>
      <link>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270777#M52706</link>
      <description>&lt;P&gt;Peter:&lt;BR /&gt;&lt;BR /&gt;Thanks! That did the trick. I owe you a drink of your choice.&lt;BR /&gt;I am working on the creators of the data to input the data in flat format...&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 18:08:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270777#M52706</guid>
      <dc:creator>markschahl</dc:creator>
      <dc:date>2020-06-04T18:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unstacking a Stacked Excel Cell or Parsing Free-form Text to Generate Multiple Rows</title>
      <link>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270789#M52711</link>
      <description>&lt;P&gt;Ha ha sounds good.&amp;nbsp; Hope to see you at Discovery 2020.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 18:47:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Unstacking-a-Stacked-Excel-Cell-or-Parsing-Free-form-Text-to/m-p/270789#M52711</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-06-04T18:47:12Z</dc:date>
    </item>
  </channel>
</rss>

