<?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: Extracting from a column that has comma delimited data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251806#M49452</link>
    <description>glad it worked well for you!</description>
    <pubDate>Wed, 11 Mar 2020 16:44:34 GMT</pubDate>
    <dc:creator>cwillden</dc:creator>
    <dc:date>2020-03-11T16:44:34Z</dc:date>
    <item>
      <title>Extracting from a column that has comma delimited data</title>
      <link>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251669#M49418</link>
      <description>&lt;P&gt;I have a column fro a query that has data within that is comma delimited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reads&lt;/P&gt;&lt;P&gt;1,2,3,2,4,3,4,5,2,1,3,4,5,2,1,3,4,2,1,2,3,4,2,1,2,4,2,3,4,5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have a script that parses out each value into a new column with the column title of D01, D02, D03 etc....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used an addin for Text to Cols to work with this column but it would great to have a script as part of post-Query script that makes those columns&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:43:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251669#M49418</guid>
      <dc:creator>UberBock</dc:creator>
      <dc:date>2020-03-10T22:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from a column that has comma delimited data</title>
      <link>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251682#M49419</link>
      <description>&lt;P&gt;There actually is a &lt;A href="https://www.jmp.com/support/help/en/15.1/#page/jmp/data-tables-3.shtml#ww2234212" target="_blank"&gt;Text to Columns()&lt;/A&gt; function.&amp;nbsp; Here's a way to do it with a table where I start with 2 columns, Column 1 and Column 2.&amp;nbsp; Because Text to Columns() will insert the new columns directly after the column being split, you need to determine the position of the column so you can easily find where the new columns are in the table to rename them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
col = "Column 1"; //name of column that needs to be split out

//Need to determine where new columns will go:
colnames = dt &amp;lt;&amp;lt; Get Column Names(string);
which_col = Loc(colnames, col)[1]; //get position of column being split

//Get number of columns before split
n_col_pre = N Col(dt);

//Split the column by delimiter
dt &amp;lt;&amp;lt; Text to Columns( delimiter(","), 
	columns(Column(dt, col))
);

//Determine number of new columns
new_cols = N Col(dt) - n_col_pre;

//Rename New Columns
for(i = 1, i &amp;lt;= new_cols, i++,
	col_pos = which_col + i; //get position of current column
	Column(dt, col_pos) &amp;lt;&amp;lt; Set Name("D"||if(i &amp;lt; 10, "0","")||char(i));
	Column(dt, col_pos) &amp;lt;&amp;lt; Set Data Type(Numeric); //makes each column numeric, not sure if you needed that too
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Before:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cwillden_0-1583884747641.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22280iF57832C77AD5A828/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cwillden_0-1583884747641.png" alt="cwillden_0-1583884747641.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cwillden_1-1583884787138.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22281i3EF0580213907BA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cwillden_1-1583884787138.png" alt="cwillden_1-1583884787138.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 11:56:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251682#M49419</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2020-03-11T11:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from a column that has comma delimited data</title>
      <link>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251760#M49435</link>
      <description>&lt;P&gt;It worked great!&amp;nbsp; Thank you.&amp;nbsp; Also thank you for the comments in the script they will help me understand it and learn from it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 13:28:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251760#M49435</guid>
      <dc:creator>UberBock</dc:creator>
      <dc:date>2020-03-11T13:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from a column that has comma delimited data</title>
      <link>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251806#M49452</link>
      <description>glad it worked well for you!</description>
      <pubDate>Wed, 11 Mar 2020 16:44:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extracting-from-a-column-that-has-comma-delimited-data/m-p/251806#M49452</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2020-03-11T16:44:34Z</dc:date>
    </item>
  </channel>
</rss>

