<?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: Split string with certain delimiters and make a new row each element (each element will further split in to columns). in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379633#M62957</link>
    <description>Hi txnelson, it works perfect !&lt;BR /&gt;Regarding the column E - it is just need to be copied from the original table. I have added in "New Column( "E", character )," &amp;amp; "dtOut:E[theRow] = dt:E[i];" to copy column E as well. Really appreciate it, thanks alot !</description>
    <pubDate>Mon, 26 Apr 2021 04:50:52 GMT</pubDate>
    <dc:creator>GR</dc:creator>
    <dc:date>2021-04-26T04:50:52Z</dc:date>
    <item>
      <title>Split string with certain delimiters and make a new row each element (each element will further split in to columns).</title>
      <link>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379552#M62953</link>
      <description>&lt;P&gt;Hi, I am new to&amp;nbsp; jmp scripting. Trying to automate split "Data" column (Input.jmp) each cell value in to individual chunks of strings using space as the delimiter and each individual chuck of string will make a new row with including row A,B,C,D,E (Output_intermediate.jmp). For the final output (Output_Final.jmp), need to further split string "Data_Coulmn_split_by_space_delimiter" to it's individual components using ":" as delimiter and an additional column (:Data1) with the 1st element first letter. I used the intermediate data set to explain how the original string needs to split and processed, not necessary to follow that order as long as result is equivalent to Output_Final.jmp. Please kindly help me. Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:29:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379552#M62953</guid>
      <dc:creator>GR</dc:creator>
      <dc:date>2023-06-10T23:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Split string with certain delimiters and make a new row each element (each element will further split in to columns).</title>
      <link>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379555#M62954</link>
      <description>&lt;P&gt;Attaching Output_Final.jmp&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 02:20:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379555#M62954</guid>
      <dc:creator>GR</dc:creator>
      <dc:date>2021-04-26T02:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split string with certain delimiters and make a new row each element (each element will further split in to columns).</title>
      <link>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379626#M62956</link>
      <description>&lt;P&gt;Here is a script that will create the data table you are asking for, with one exception.&amp;nbsp; I am at a loss on how to construct your column E.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new.PNG" style="width: 721px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/32328iFB823AFA2A8C84EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="new.PNG" alt="new.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Data Table( "Input" );
dtOut = New Table( "Final Output",
	New Column( "A" ),
	New Column( "B", character ),
	New Column( "C" ),
	New Column( "D" ),
	New Column( "Data_1", character ),
	New Column( "Data_2", character ),
	New Column( "Data_3", character ),
	New Column( "Data_4", character ),
	New Column( "Data_5", character ),
	New Column( "Data_6", character ), 

);
For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	If( i == 1,
		theRow = 0;
		theRow = N Rows( dtOut );
	);
	If( dt:Data_Column[i] != "X",
		dtOut &amp;lt;&amp;lt; Add Rows( 3 );
		For( k = 1, k &amp;lt;= 3, k++,
			theRow++;
			dtOut:A[theRow] = dt:A[i];
			dtOut:B[theRow] = dt:B[i];
			dtOut:C[theRow] = dt:C[i];
			dtOut:D[theRow] = dt:D[i];
			dtOut:Data_1[theRow] = Substr( Word( k, dt:Data_Column[i], " " ), 1, 1 );
			dtOut:Data_2[theRow] = Substr( Word( 1, Word( k, dt:Data_Column[i], " " ), ":" ), 2 );
			dtOut:Data_3[theRow] = Word( 2, Word( k, dt:Data_Column[i], " " ), ":" );
			dtOut:Data_4[theRow] = Word( 3, Word( k, dt:Data_Column[i], " " ), ":" );
			dtOut:Data_5[theRow] = Word( 4, Word( k, dt:Data_Column[i], " " ), ":" );
			dtOut:Data_6[theRow] = Word( 5, Word( k, dt:Data_Column[i], " " ), ":" );
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;P.S.&amp;nbsp; &amp;nbsp;You have a typo in the data table column name called Data_Column.......it is incorrectly spelled Data_Coulmn&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 03:41:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379626#M62956</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-26T03:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Split string with certain delimiters and make a new row each element (each element will further split in to columns).</title>
      <link>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379633#M62957</link>
      <description>Hi txnelson, it works perfect !&lt;BR /&gt;Regarding the column E - it is just need to be copied from the original table. I have added in "New Column( "E", character )," &amp;amp; "dtOut:E[theRow] = dt:E[i];" to copy column E as well. Really appreciate it, thanks alot !</description>
      <pubDate>Mon, 26 Apr 2021 04:50:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Split-string-with-certain-delimiters-and-make-a-new-row-each/m-p/379633#M62957</guid>
      <dc:creator>GR</dc:creator>
      <dc:date>2021-04-26T04:50:52Z</dc:date>
    </item>
  </channel>
</rss>

