<?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 to match part of text in 2 column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735104#M91605</link>
    <description>&lt;P&gt;Hi Jarmo, Thank you for your help again. But, even I use your 735102.jmp dataset and copy/paste the command, it don't work. Could you please to provide me the script on 735102.jmp file?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 20:04:34 GMT</pubDate>
    <dc:creator>doraemengs</dc:creator>
    <dc:date>2024-03-14T20:04:34Z</dc:date>
    <item>
      <title>How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735081#M91599</link>
      <description>&lt;P&gt;Hi everyone, I would like to ask about this data set&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Column A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Column B&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Column C&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Column D&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A*05:01 A*25:01 B*08:01 B*39:01 C*05:01 C*07:06 C*07:18 C*12:03 DRB1*05:01 DRB1*07:01 DRB3*01:01 DRB4*09:03N DQA1*02:01 DQA1*05:01 DQB1*02:01 DQB1*02:02&lt;/TD&gt;&lt;TD&gt;DQA1*01-03,DQB1*06-03_DQ6&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;A*20:01 A*60:02 B*08:01 B*28:03 C*02:02 C*03:04 DRB1*01:02 DRB1*13:04 DRB3*02:02 DRB3*02:02 DQA1*01:01 DQA1*01:04 DQA1*01:05 DQA1*05:05 DQA1*05:09 DQB1*02:01 DQB1*05:01&lt;/TD&gt;&lt;TD&gt;DQA1*05-01,DQB1*02-01_DQ2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A*01:01 A*01:01 B*08:01 B*38:01 C*06:02 C*09:01 C*07:06 C*07:18 DRB1*07:01 DRB1*07:01 DRB4*01:01 DRB4*01:03 DRB4*01:05N DQA1*02:01 DQA1*02:01 DQB1*02:02 DQB1*03:03&lt;/TD&gt;&lt;TD&gt;DQA1*03-03,DQB1*04-01_DQ4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4....&lt;/TD&gt;&lt;TD&gt;A*01:01 A*01:01 B*08:01 B*38:01 C*06:02 C*09:01 C*07:06 C*07:18 DRB1*07:01 DRB1*07:01 DRB4*01:01 DRB4*01:03 DRB4*01:05N DQA1*02:01 &lt;FONT color="#FF0000"&gt;DQA1*03:03&lt;/FONT&gt; DQB1*02:02 DQB1*03:03&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;DQA1*03-03&lt;/FONT&gt;,DQB1*04-01_DQ4&lt;/TD&gt;&lt;TD&gt;DQA1*02:01 &lt;FONT color="#FF0000"&gt;DQA1*03:03&lt;/FONT&gt; DQB1*02:02 DQB1*03:03&lt;/TD&gt;&lt;TD&gt;DQA1*03:03&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1: How can i do? I want to extract text only DQA1... and DQB1... in column A into column C.&lt;/P&gt;&lt;P&gt;Q2: How can I do? I want to match the extract text in column B and column C in the same row into column D&lt;/P&gt;&lt;P&gt;I try to use the regex command - but the problem occur with * and :, and I have no idea how to match part of text with two column in multiple ID...&lt;/P&gt;&lt;P&gt;I put the thing that I want into the ID 4., in this case : and - are the same.&lt;/P&gt;&lt;P&gt;Thank you for your help in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 18:09:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735081#M91599</guid>
      <dc:creator>doraemengs</dc:creator>
      <dc:date>2024-03-14T18:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735094#M91602</link>
      <description>&lt;P&gt;For Column D you could use Words(), Substitute() and Associative Array() + Intersect, in a formula, to find exact matches&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;aa1 = Associative Array(Words(:Column B, ",")); 
aa2 = Associative Array(Words(Substitute(:Column C, ":", "-"), " \!N"));
aa1 &amp;lt;&amp;lt; Intersect(aa2);
Concat Items(aa1 &amp;lt;&amp;lt; Get Keys, ",");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For Column C you can get good ideas from &lt;LI-MESSAGE title="Regex: can't get all parts of the string that match" uid="730835" url="https://community.jmp.com/t5/Discussions/Regex-can-t-get-all-parts-of-the-string-that-match/m-p/730835#U730835" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;Here is one option for Column C which might work. If you don't understand what it does, I suggest using While loop and Regex as that is generally easier to understand than JMP's pattern matching.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;result = {};
Pat Match(
	:Column A,
	Pat Repeat(
		(Pat Regex("(DQ[AB]1.+)[\s$]") &amp;gt;&amp;gt; result)
	| 
		Pat Len(1)
	)
);
Concat Items(Words(result, " "), ", ");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1710444204917.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62205i6D76B6C8208B5DCC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1710444204917.png" alt="jthi_0-1710444204917.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 19:23:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735094#M91602</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-14T19:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735102#M91603</link>
      <description>&lt;P&gt;Thank you for your advice, but on column C generation, the error occurred as&lt;/P&gt;&lt;P&gt;attempting to assign to an object that is not an L-value in access or evaluation of 'Assign' , Current Data Table() &amp;lt;&amp;lt; result =&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;/*###*/{} /*###*/" and&lt;/P&gt;&lt;P class=""&gt;Must be a string or 1x2 matrix in access or evaluation of 'Words' , Bad Argument( result ), Words/*###*/(result, " ")&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;please guided me more!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 19:37:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735102#M91603</guid>
      <dc:creator>doraemengs</dc:creator>
      <dc:date>2024-03-14T19:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735103#M91604</link>
      <description>&lt;P&gt;Did you copy paste the formula there directly? As I don't have your data table there might differences in the separators used (see the attached file).&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 19:57:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735103#M91604</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-14T19:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735104#M91605</link>
      <description>&lt;P&gt;Hi Jarmo, Thank you for your help again. But, even I use your 735102.jmp dataset and copy/paste the command, it don't work. Could you please to provide me the script on 735102.jmp file?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 20:04:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735104#M91605</guid>
      <dc:creator>doraemengs</dc:creator>
      <dc:date>2024-03-14T20:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735109#M91606</link>
      <description>&lt;P&gt;Open the table and check out the formulas added to Column C and Column D (they both have formulas).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1710446870720.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62207i0503A3A348D9C592/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1710446870720.png" alt="jthi_0-1710446870720.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you are not sure how to create formulas in JMP, check out JMP Help page &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/create-formulas-in-jmp.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/17.2/#page/jmp/create-formulas-in-jmp.shtml#&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 20:08:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735109#M91606</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-14T20:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to match part of text in 2 column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735115#M91607</link>
      <description>&lt;P&gt;Thank you for your help! it's work now.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 20:59:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-match-part-of-text-in-2-column/m-p/735115#M91607</guid>
      <dc:creator>doraemengs</dc:creator>
      <dc:date>2024-03-14T20:59:13Z</dc:date>
    </item>
  </channel>
</rss>

