<?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: Substring of a file name column between uknown number of characters in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563717#M77654</link>
    <description>&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try this method already and again just now. It ends up removing everything after the first '#' character. So now I'm getting this for each row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Test Name Date ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like it may be possible using munger or substr but I'm not getting that to work either.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 21:10:38 GMT</pubDate>
    <dc:creator>trevorphysics</dc:creator>
    <dc:date>2022-11-02T21:10:38Z</dc:date>
    <item>
      <title>Substring of a file name column between uknown number of characters</title>
      <link>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563663#M77648</link>
      <description>&lt;P&gt;When i input data I end up with a file name column that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;File Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test Name Date ID# Wafer and Device ID1 #ID comment&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test Name Date ID# Wafer and Device ID2 #ID different comment&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Different Test Name Date ID# Wafer and Device ID1 #ID comment&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Different Test Name Date ID# Wafer and Device ID2 #ID different comment&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;File Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Wafer and Device ID1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Wafer and Device ID2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Wafer and Device ID1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Wafer and Device ID2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of these have different delimiters and string lengths, what I want to do is extract the Wafer and Device ID from with the 'ID# ' and ' #ID' characters minus the spaces. I'm finding a lot of information on taking out a specific number of characters, but I am struggling to find any information on searching a string and removing a string (in this case 'ID# ' and everything before) from the left and a string (in this case ' #ID ' and everything after) from the right and leaving the string in the middle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:56:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563663#M77648</guid>
      <dc:creator>trevorphysics</dc:creator>
      <dc:date>2023-06-10T23:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Substring of a file name column between uknown number of characters</title>
      <link>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563701#M77652</link>
      <description>&lt;P&gt;The Word() function can do this easily.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
For Each Row(
	:File Name = Word( 1, :File Name, "#" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2022 21:02:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563701#M77652</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-11-02T21:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Substring of a file name column between uknown number of characters</title>
      <link>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563717#M77654</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try this method already and again just now. It ends up removing everything after the first '#' character. So now I'm getting this for each row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Test Name Date ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like it may be possible using munger or substr but I'm not getting that to work either.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 21:10:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563717#M77654</guid>
      <dc:creator>trevorphysics</dc:creator>
      <dc:date>2022-11-02T21:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Substring of a file name column between uknown number of characters</title>
      <link>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563736#M77655</link>
      <description>&lt;P&gt;Oops....just change to extract the second word&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
For Each Row(
	:File Name = Word( 2, :File Name, "#" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please take the time to read about the Word() function in the Scripting Index.&amp;nbsp; It will show what each element can be, and an example of how it works.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 21:28:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/563736#M77655</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-11-02T21:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Substring of a file name column between uknown number of characters</title>
      <link>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/564268#M77676</link>
      <description>&lt;P&gt;I love using the Word() function when the extraction is simple. Here is another approach using the Regex() function. The same approach can be used if the extraction pattern is not simple, just by changing the regular expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

// set up example
dt = New Table( "Untitled",
	Add Rows( 4 ),
	New Column( "File Name",
		Character,
		"Nominal",
		Set Values(
			{"Test Name Date ID# Wafer and Device ID1 #ID comment",
			"Test Name Date ID# Wafer and Device ID2 #ID different comment",
			"Different Test Name Date ID# Wafer and Device ID1 #ID comment",
			"Different Test Name Date ID# Wafer and Device ID2 #ID different comment"
			}
		)
	)
);

// make a data column for result
dt &amp;lt;&amp;lt; New Column( "Extract", "Character", "Nominal" );

// compute row-wise result
For Each Row(
	:Extract = Regex( :File Name, "ID# (.+) #ID", "\1" );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="exract.PNG" style="width: 880px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/46861i3041868E724018B7/image-size/large?v=v2&amp;amp;px=999" role="button" title="exract.PNG" alt="exract.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 13:43:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Substring-of-a-file-name-column-between-uknown-number-of/m-p/564268#M77676</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-11-03T13:43:48Z</dc:date>
    </item>
  </channel>
</rss>

