<?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: How do I parse data to column then stack them with multiple special characters in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/748117#M92818</link>
    <description>&lt;P&gt;Thanks Jim a lot for your solution.&lt;/P&gt;&lt;P&gt;Thinh&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 08:25:24 GMT</pubDate>
    <dc:creator>ducthinh279</dc:creator>
    <dc:date>2024-04-19T08:25:24Z</dc:date>
    <item>
      <title>How do I parse data to column then stack them with multiple special characters</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/745064#M92485</link>
      <description>&lt;P&gt;I have a raw data need to text to column with many special character, then stack them. Could you please help provide solution by JSL script for generic case. Please help to refer my excel file for detail&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 09:38:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/745064#M92485</guid>
      <dc:creator>ducthinh279</dc:creator>
      <dc:date>2024-04-07T09:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse data to column then stack them with multiple special characters</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/745087#M92487</link>
      <description>&lt;P&gt;Here is the script that will take the original data table and split out a target column and then stack the results.&amp;nbsp; Given that some of the split out columns are made up of just string data, and some appear to be numeric values, the stacking of all of the columns does not seem to be what you probably want.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

targetCol = "domain_frequency_core";

// Text to columns
Data Table( "Book1 (4)_Sheet1" ) &amp;lt;&amp;lt;
Text to Columns( columns( Column( targetCol ) ), Delimiters( "@" ) );

// Get list of all target columns except original column
stackList = Filter Each( {name}, dt &amp;lt;&amp;lt; get column names( string ),
	Contains( name, targetCol ) &amp;amp; name != targetCol
);

// Stack the new columns
dt &amp;lt;&amp;lt; Stack(
	columns( stackList ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" ),
	Output Table( "Final Stacked Data Table" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please take the time to study the script.&amp;nbsp; All of the functions and platforms used are documented in the Scripting Index and in the JMP Help screens.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 11:27:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/745087#M92487</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-07T11:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse data to column then stack them with multiple special characters</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/746835#M92577</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;Look like you misunderstand my data, the code you were wrote is the output.&lt;/P&gt;&lt;P&gt;Kindly help to refer sheet "Raw data"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ducthinh279_0-1712818894475.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63254i8EE5BCE672D968B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ducthinh279_0-1712818894475.png" alt="ducthinh279_0-1712818894475.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Output expected in sheet "Data after parse"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ducthinh279_1-1712818955541.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63255iC01858B8C6EE1091/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ducthinh279_1-1712818955541.png" alt="ducthinh279_1-1712818955541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 07:12:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/746835#M92577</guid>
      <dc:creator>ducthinh279</dc:creator>
      <dc:date>2024-04-11T07:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse data to column then stack them with multiple special characters</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/746849#M92585</link>
      <description>&lt;P&gt;Here is my first pass script.&amp;nbsp; The approach should give you what you need to see what might need to be adjusted with your complete data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

// Create the new columns
dt &amp;lt;&amp;lt; New Column( "domain_frequency_core", character );
dt &amp;lt;&amp;lt; New Column( "Data" );

// Create the static part for the column domain_frequency_core
startString = "Data@" || Word( 1, :string_result[1], ":" );

// Read into a memory variable the entire string, minus the startString component
theString = Word( 2, :string_result[1], ":_" );

// Initialize the looping variables
outerLoop = 1;
theRow = 0;

// Loop through the major groupings in the data
While( Word( outerLoop, theString, "%" ) != "",
	// Strip off the subpart of the string
	majorWord = Word( outerLoop, theString, "%" );
	// Get the second component of the start string
	startStringSuffix = "@" || word(1,majorWord,"^") || "@";
	
	// Initialize the inner loop value, starting with word 2
	innerLoop=2;
	// Loop through the subgroup finding each numeric component
	While( word(innerLoop, majorWord, "^V") != "",
		// Add a new row
		if(theRow !=0, dt&amp;lt;&amp;lt;add rows(1));
		theRow++;
		// Add the new column values
		:unit[theRow]=:unit[1];
		:domain_frequency_core[theRow]= startString || startStringSuffix || char(innerLoop-2) ;
		:Data[theRow]=num(word(innerLoop, majorWord, "^V"));
		innerLoop++;
	);
	outerLoop++;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1712831359209.png" style="width: 668px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63259i1123569D89D26136/image-dimensions/668x330?v=v2" width="668" height="330" role="button" title="txnelson_0-1712831359209.png" alt="txnelson_0-1712831359209.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 10:29:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/746849#M92585</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-11T10:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse data to column then stack them with multiple special characters</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/748117#M92818</link>
      <description>&lt;P&gt;Thanks Jim a lot for your solution.&lt;/P&gt;&lt;P&gt;Thinh&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 08:25:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-parse-data-to-column-then-stack-them-with-multiple/m-p/748117#M92818</guid>
      <dc:creator>ducthinh279</dc:creator>
      <dc:date>2024-04-19T08:25:24Z</dc:date>
    </item>
  </channel>
</rss>

