<?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 Import Excel data from specific Excel cells in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352645#M60199</link>
    <description>&lt;P&gt;I have situation where the data I need to analyze in JMP is stored somewhat haphazardly in in an Excel file.&amp;nbsp; I fortunately can easily get a list of the Excel cells that the data is in, and I would like to automate with JSL importing those values.&amp;nbsp; I am looking for ideas on how to do this effectively and efficiently.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, let's say the data I need in a single column in JMP&amp;nbsp; is stored in these excel cells&lt;BR /&gt;E284,E400,E507,D615,E727,D852,E1003,E1114,D1220,D1339,E1493&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using Open() and specifying the worksheet, starting Row, Ending Row, Starting Column, Ending Column to just get each value in a JMP file with a single row/column, e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"C:\temp\worksheet.xlsx",
	Worksheets( "sheet1" ),
	Use for all sheets( 0 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 0 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 284 ),  // get data on row 284
		Data Starts on Column( 5 ), // get data on column "E" (the fifth column)
		Data Ends on Row( 284 ), // get data on row 284
		Data Ends on Column( 5 ), // get data on column "E" (the fifth column)
		Replicated Spanned Rows( 1 ),
		Replicated Spanned Headers( 0 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 1 ),
		Suppress Empty Columns( 1 ),
		Treat as Hierarchy( 0 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "-" )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would then get a separate data file for each value I want to retrieve from a specific cell and then gather the values in the separate JMP files all together in to one data table in one column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One problem I am facing is that it seems that when you open an excel file, all the blank rows at the top of the excel worksheet are ignored?&amp;nbsp; So row 1 is not really row 1 unless there is some data in row 1.&amp;nbsp; Is that true?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other ideas would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 22:04:10 GMT</pubDate>
    <dc:creator>MathStatChem</dc:creator>
    <dc:date>2023-06-09T22:04:10Z</dc:date>
    <item>
      <title>Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352645#M60199</link>
      <description>&lt;P&gt;I have situation where the data I need to analyze in JMP is stored somewhat haphazardly in in an Excel file.&amp;nbsp; I fortunately can easily get a list of the Excel cells that the data is in, and I would like to automate with JSL importing those values.&amp;nbsp; I am looking for ideas on how to do this effectively and efficiently.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, let's say the data I need in a single column in JMP&amp;nbsp; is stored in these excel cells&lt;BR /&gt;E284,E400,E507,D615,E727,D852,E1003,E1114,D1220,D1339,E1493&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using Open() and specifying the worksheet, starting Row, Ending Row, Starting Column, Ending Column to just get each value in a JMP file with a single row/column, e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"C:\temp\worksheet.xlsx",
	Worksheets( "sheet1" ),
	Use for all sheets( 0 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 0 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 284 ),  // get data on row 284
		Data Starts on Column( 5 ), // get data on column "E" (the fifth column)
		Data Ends on Row( 284 ), // get data on row 284
		Data Ends on Column( 5 ), // get data on column "E" (the fifth column)
		Replicated Spanned Rows( 1 ),
		Replicated Spanned Headers( 0 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 1 ),
		Suppress Empty Columns( 1 ),
		Treat as Hierarchy( 0 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "-" )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would then get a separate data file for each value I want to retrieve from a specific cell and then gather the values in the separate JMP files all together in to one data table in one column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One problem I am facing is that it seems that when you open an excel file, all the blank rows at the top of the excel worksheet are ignored?&amp;nbsp; So row 1 is not really row 1 unless there is some data in row 1.&amp;nbsp; Is that true?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other ideas would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:04:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352645#M60199</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2023-06-09T22:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352670#M60202</link>
      <description>&lt;P&gt;Do you have information that you can use to identify the cells other than the Excel cell reference.&amp;nbsp; For example, perhaps a field label?&amp;nbsp; I usually load the data from Excel into JMP with minimal processing, then simply iterate over rows and columns searching for key information.&amp;nbsp; Typically the first scan will identify the column that contains the field labels that I am interested in, and the second scan will then load the field values.&amp;nbsp; In this way I can build up either lists of data from which I can build a table, or header information which I can set as table variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example - scanning to find a column containing a specific field label&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;			identifier = "Description";
			cols = dt&amp;lt;&amp;lt;getcolumnnames(string,Nominal);
			lblCol = 0;
			success = 0;
			for (r=1,r&amp;lt;=nrows(dt),r++,
				if (success,break());
				for (c=1,c&amp;lt;=nitems(cols),c++,
					cell = column(dt,cols[c])[r];
					if (contains(cell,identifier),
						success = 1;
						lblCol = cols[c];
						break()
					)
				)
			)	&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;And then scanning for fields&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		fields = [=&amp;gt;];
		fields["Description"] = 0;
		fields["USL"] = 0;
		fields["LSL"] = 0;
		fields["Nominal"] = 0;
		keys = fields &amp;lt;&amp;lt; getKeys;
		for (i=1,i&amp;lt;=nitems(keys),i++,
			field = keys[i];
			success = 0;
			for (r=1,r&amp;lt;=nrow(dt),r++,
				cell = column(dt,lblCol)[r];
				if (contains(cell,field),
					success = 1;
					fields[field] = r;
					break()
				)
			)
		);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 20:21:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352670#M60202</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2021-01-25T20:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352682#M60203</link>
      <description>&lt;P&gt;Simple answer is "no".&amp;nbsp; If if did have some other way to reference the location of the data, I'd try your approach, but in this case the Excel cell reference is the primary way to find the data.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 20:20:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352682#M60203</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2021-01-25T20:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352683#M60204</link>
      <description>&lt;P&gt;I did just remember that, yes indeed, for an Excel worksheet with empty cells at the top of the sheet, those rows are ignored.&amp;nbsp; See&amp;nbsp;&lt;A href="https://www.jmp.com/support/notes/60/026.html" target="_self"&gt;https://www.jmp.com/support/notes/60/026.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;LI-MESSAGE title="Excel Import Improvement: Show Row Numbers and Column Labels in import preview" uid="79946" url="https://community.jmp.com/t5/JMP-Wish-List/Excel-Import-Improvement-Show-Row-Numbers-and-Column-Labels-in/m-p/79946#U79946" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea 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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 21:58:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352683#M60204</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2021-01-25T21:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352689#M60208</link>
      <description>&lt;P&gt;This is a slightly extreme hack, although I use similar techniques to create PPTX and DOC files ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;XLSX is just a zip file containing XML files.&amp;nbsp; You can use the XML to reference cell coordinates:&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="xl-xml.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29705i6ADB81422DE50331/image-size/large?v=v2&amp;amp;px=999" role="button" title="xl-xml.png" alt="xl-xml.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use ZipArchive to get to the XML files.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 21:10:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352689#M60208</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2021-01-25T21:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352711#M60211</link>
      <description>&lt;P&gt;That is an interesting idea.&amp;nbsp; I had no idea that was what was "under the hood" of an XLSX file.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 21:27:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352711#M60211</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2021-01-25T21:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352793#M60219</link>
      <description>&lt;P&gt;Here's an example (probably better ways of parsing XML but pattern matching functions do the job for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	/*----------------------------------------------------------------------
	Method: getWorksheets
	----------------------------------------------------------------------*/	
	getWorksheets = method({username=1},
	
		// this technique (including the overhead of creating the class,
		// is &amp;gt;300 x faster than getExcelWorksheets on Mac
		// and &amp;gt;100 x faster on Windows

		workbook = "xl/workbook.xml";
		za = open(_excelFilePath,zip);	
		contents = za&amp;lt;&amp;lt;read(workbook);
		pat = "&amp;lt;sheet name=\!"" 
			+ PatRepeat(PatNotAny("\!""))&amp;gt;&amp;gt;sheet + "\!"" 
			+ " sheetId=\!"" + PatRepeat(PatNotAny("\!"")) + "\!""
			+ (" r:id=\!"" + PatRepeat(PatNotAny("\!"")) + "\!"" | " state=\!"hidden\!"" + " r:id=\!"" + PatRepeat(PatNotAny("\!"")) + "\!"")&amp;gt;&amp;gt;x;
		ismatch = 1;
		lstWorksheets = {};
		while(ismatch,
			ismatch = patmatch(contents,pat,"");
			if (!contains(x,"hidden"),
				substituteinto(sheet,"&amp;amp;amp;","&amp;amp;");
				if (!contains(lstWorksheets,sheet),	
					insertinto(lstWorksheets,sheet)
				)
			)
		);		
				
		return(lstWorksheets);
	),&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 06:36:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/352793#M60219</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2021-01-26T06:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data from specific Excel cells</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/353998#M60369</link>
      <description>&lt;P&gt;I found an easier workaround in Excel.&amp;nbsp; There is an INDIRECT(cellref) function in Excel that you use to get a result from a specific cell.&amp;nbsp; So I was able to make a new excel sheet and create columns that indicate the sheet and cell that the data is in and use the INDIRECT function to get a table of results that I needed for analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do think, though, this problem highlights some improvements needed for the Excel import in JMP.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 16:08:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-from-specific-Excel-cells/m-p/353998#M60369</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2021-01-29T16:08:26Z</dc:date>
    </item>
  </channel>
</rss>

