<?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 extract excel filename in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16036#M14632</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The file name is part of the "Source" script. I think this works (assuming POSIX path):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;fname.old &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Word&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Arg&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Get property&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #942193;"&gt;"Source"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"/"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Dec 2015 00:01:30 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2015-12-22T00:01:30Z</dc:date>
    <item>
      <title>How do I extract excel filename from a user-selected file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16034#M14630</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't seem to figure out how to extract the original file name of an Excel workbook that a user selects.&amp;nbsp; After selecting the appropriate file as shown below, the actual file name I get is the worksheet name (sheet 1), not the original file name (test_data.xls). I'm ultimately trying to rename the originally selected excel file and need the file name, not the opened worksheet name, to accomplish this. Any ideas how I can accomplish this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dt = Open(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Pick File( "Select Excel File", "$dir_rawdata/", {"All Files|*"}, ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Worksheets( "1" ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Use for all sheets( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Concatenate Worksheets( 0 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Create Concatenation Column( 0 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Worksheet Settings(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Has Column Headers( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Number of Rows in Headers( 3 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Headers Start on Row( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Data Starts on Row( 4 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Data Starts on Column( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Data Ends on Row( 0 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Data Ends on Column( 0 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Replicated Spanned Rows( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Suppress Hidden Rows( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Suppress Hidden Columns( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Suppress Empty Columns( 1 ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Treat as Hierarchy( 0 )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fname.old = dt &amp;lt;&amp;lt; Get Name;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 16:18:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16034#M14630</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2018-01-02T16:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract excel filename</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16035#M14631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've managed to extract excelfile name using the word() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excelfile = pick file ("Select your CSV File(s)", "", {"JMP Files|csv", "All Files|*"}, 1, 0, "", "multiple" );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ( [logic],&lt;/P&gt;&lt;P&gt;&amp;nbsp; SampName&lt;I&gt; = Word( -1, &lt;SPAN style="font-size: 13.3333px;"&gt;Excelfile &lt;/SPAN&gt;&lt;I&gt;, "/" );&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ExcelName&lt;I&gt; = Word( 1, SampName&lt;I&gt;, "." );&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file contents = Load Text File( &lt;SPAN style="font-size: 13.3333px;"&gt;Excelfile &lt;/SPAN&gt;&lt;I&gt; );&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//use the file cotents to phrase through your rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the ExcelName will give you the name of your excelfile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 23:56:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16035#M14631</guid>
      <dc:creator>anders_bankefor</dc:creator>
      <dc:date>2015-12-21T23:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract excel filename</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16036#M14632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The file name is part of the "Source" script. I think this works (assuming POSIX path):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;fname.old &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Word&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Arg&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Get property&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #942193;"&gt;"Source"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"/"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 00:01:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16036#M14632</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-12-22T00:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract excel filename</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16037#M14633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks folks for your suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was playing around and realized I needed to define a data table from the file selected in the Pick File function: dt.select = Pick File( "Select Excel File", ...... Once I did that I was easily able to parse out the file name using the Word function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MS, thanks for the clever way of extracting the file name from the Source property.&amp;nbsp; That was a really clever and learning about the use of -1 Word was very helpful.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 16:50:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16037#M14633</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2015-12-22T16:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract excel filename</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16038#M14634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats a good idea, it all depends on what your script should do. Personally I had the need of reading in several excel files at once, therefore I stored the files into a list and phrased them using for-loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excelfile = {}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excelfile = pick file ()...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best of luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 19:09:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-extract-excel-filename-from-a-user-selected-file/m-p/16038#M14634</guid>
      <dc:creator>anders_bankefor</dc:creator>
      <dc:date>2015-12-22T19:09:14Z</dc:date>
    </item>
  </channel>
</rss>

