<?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: Accessing .jmp file row/col count and notes without opening file in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/385499#M63556</link>
    <description>&lt;P&gt;Thanks for highlighting one of the benefits of attending &lt;A href="https://discoverysummit.jmp" target="_self"&gt;Discovery Summit&lt;/A&gt; and Meet the Developers/Ask the Experts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a result of your conversation and this post in JMP 17 we'll be adding a JSL option to get the number of rows and columns in a data table, along with the names of the columns and the contents of the Notes property if it exists. Bravo!&lt;/P&gt;</description>
    <pubDate>Fri, 14 May 2021 22:41:46 GMT</pubDate>
    <dc:creator>Jeff_Perkinson</dc:creator>
    <dc:date>2021-05-14T22:41:46Z</dc:date>
    <item>
      <title>Accessing .jmp file row/col count and notes without opening file</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366316#M61612</link>
      <description>&lt;P&gt;This information can be accessed through JMP Open file at least on Windows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1615283854316.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31110iBC040ACAFD05F1F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1615283854316.png" alt="jthi_0-1615283854316.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wondering if it possible to access these through scripting without opening JMP datatable (&lt;A href="https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/open-data-file-options.shtml" target="_self"&gt;Open Data File Options&lt;/A&gt;&amp;nbsp;)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column names can be accessed with&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp", "Column Names Only");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&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:26:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366316#M61612</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-10T23:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing .jmp file row/col count and notes without opening file</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366427#M61618</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I do not know how to get that information from the open window dialogue in JMP, but you could do something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt=open("$SAMPLE_DATA/Big Class.jmp", Invisible);
Show(Nrows(dt));
Show(NCols(dt));
Close(dt);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; It should return the following in the Log window or embedded log of the Scripting window:&lt;/P&gt;&lt;P&gt;N Rows(dt) = 40;&lt;BR /&gt;N Cols(dt) = 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The "Invisible" in the open command will not make the data table come up to the front and sort of hides it in the background. You could even do a Show Properties(dt) command and get a much more extensive list of information on the data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I know it's not exactly what you want, but it can do the job, I think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 15:30:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366427#M61618</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-03-09T15:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing .jmp file row/col count and notes without opening file</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366443#M61620</link>
      <description>I would suggest specifying "Private" rather than "Invisible".  It doesn't make JMP work as hard, since it doesn't have to create the display objects.</description>
      <pubDate>Tue, 09 Mar 2021 15:51:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366443#M61620</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-03-09T15:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing .jmp file row/col count and notes without opening file</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366499#M61623</link>
      <description>&lt;P&gt;The way JMP shows it in Open Data File menu is way faster (maybe...). I have some tables which are quite wide, 60columns, and very tall, ~15million rows. Opening these is fairly slow. I can get column count by opening it only as column names and maybe row count by opening datatable only as single column but all rows, but I think this will still be slower. Of course it could be possible that JMP is doing something like this behind the scenes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could maybe implement something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dtPath = "$SAMPLE_DATA/Probe.jmp";
//dtPath = "$SAMPLE_DATA/Alcohol.jmp"; //table with notes
colNames = Open(dtPath, "Column Names Only");
colCount = N Items(colNames);
dt_temp = Open(dtPath, Select Columns([1]), Private);
notesTableVar = dt_temp &amp;lt;&amp;lt; Get Table Variable("Notes");
rowCount = N Rows(dt_temp);
dt_temp = Empty();
Show(colCount, rowCount, notesTableVar);
//Show(colNames);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Because Discovery Summit is currently going, maybe I hop in to one of the Meet-The-Developer sessions and ask this also there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:57:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366499#M61623</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-09T16:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing .jmp file row/col count and notes without opening file</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366881#M61669</link>
      <description>&lt;P&gt;I attended Meet the Developers session today in the Discovery Summit to ask about this. It seems that a solution like the one I posted earlier (get column names, N&amp;nbsp; Items() those for column count, open datatable with one column as private and N Rows() for row count) is currently the fastest way to do this. They took a note so maybe in future it will be possible without opening even private datatables or JMP will provide functionalities to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the script in function format. They suggested to add Close for the dt_temp. This script might need Wait(0); here and there, but as it did work without them I haven't added any.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/td-p/366316

//Function to get column count, rowcount, table notes and column names to associative array
getTableInfo = function({path_to_table}, {Default Local},
	//Check that file exists
	If(!File Exists(path_to_table),
		return(Associative Array({"error"}, {"File not found"}));
	);
	
	//Initialize associative array
	retVal = Associative Array(
		{"name", "rowCount", "columnCount", "notes", "columnNames"},
		{"", 0, 0, "", {}}
	);
	//Open datatable as columns only list
	colNames = Open(path_to_table, "Column Names Only");
	//Check that table has atleast one column
	If(N Items(colNames) &amp;gt; 0,
		retVal["columnNames"] = colNames;
		retVal["columnCount"] = N Items(colNames);
		dt_temp = Open(path_to_table, Select Columns([1]), Private);
		retVal["name"] = dt_temp &amp;lt;&amp;lt; get name();
		retVal["rowCount"]  = N Rows(dt_temp);
	);
	//Get notes from "Notes" table variable
	retVal["notes"] = dt_temp &amp;lt;&amp;lt; Get Table Variable("Notes");
	Close(dt_temp, no save);
	return(retVal);
);

//Examples with tables from $SAMPLE_DATA
aa_probe = getTableInfo("$SAMPLE_DATA/Probe.jmp");
Show(aa_probe["name"],aa_probe["rowCount"], aa_probe["columnCount"], aa_probe["notes"]);
Show(getTableInfo("$SAMPLE_DATA/Alcohol.jmp"));
Show(getTableInfo("$SAMPLE_DATA/Alcohol.jmpmissing"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Mar 2021 19:08:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/366881#M61669</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-10T19:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing .jmp file row/col count and notes without opening file</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/385499#M63556</link>
      <description>&lt;P&gt;Thanks for highlighting one of the benefits of attending &lt;A href="https://discoverysummit.jmp" target="_self"&gt;Discovery Summit&lt;/A&gt; and Meet the Developers/Ask the Experts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a result of your conversation and this post in JMP 17 we'll be adding a JSL option to get the number of rows and columns in a data table, along with the names of the columns and the contents of the Notes property if it exists. Bravo!&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 22:41:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/m-p/385499#M63556</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2021-05-14T22:41:46Z</dc:date>
    </item>
  </channel>
</rss>

