<?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: Import Excel data where not all the information is found in a single row or column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210433#M42143</link>
    <description>&lt;P&gt;If the multiple lines you are referring to, are additional lines after line 8, that are of the same structure as line 8, then the following script will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtOrig = Open(
	"&amp;lt;Path to File&amp;gt;\Excel_import_example_file.xlsx",
	Worksheets( "example" ),
	Use for all sheets( 1 ),
	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( 1 ),
		Data Starts on Column( 1 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		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( "-" )
	)
);

// Create a new table with the Column names on row 7 from the original
dtResult = New Table( "Final" );
dtResult &amp;lt;&amp;lt; New Column( "Name", Character );
col = 1;
While( col &amp;gt; 0,
	dtResult &amp;lt;&amp;lt; New Column( dtOrig[7, col] );
	If( Left( dtOrig[1, col + 1], 5 ) == "Name:",
		col = -1
	);
	col = col + 1;
);

For( theRow = 8, theRow &amp;lt;= N Rows( dtOrig ), theRow++, 
// Now Populate the Table
	For( col = 1, col &amp;lt;= N Cols( dtOrig ), col++,
		If( Left( dtOrig[1, col], 5 ) == "Name:",
			dtResult &amp;lt;&amp;lt; Add Rows( 1 );
			resultCol = 1;
			Column( dtResult, resultCol )[N Rows( dtResult )] = Trim( Substr( Column( dtOrig, col )[1], 6 ) );
		);
		resultCol = resultCol + 1;
		Column( dtResult, resultCol )[N Rows( dtResult )] = Num( Column( dtOrig, col )[theRow] );
	)
);
Close( dtOrig, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 May 2019 03:08:56 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-05-24T03:08:56Z</dc:date>
    <item>
      <title>Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/208715#M41928</link>
      <description>&lt;P&gt;I am trying to import an ExceI data file&amp;nbsp;that&amp;nbsp;has the name in Row 1 but the actual data column headers start on Row 7 and data starts in Row 8 (please see&amp;nbsp;attached file).&amp;nbsp; I would like to have the imported data look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Flow-acft&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concentration-ug/L (25)&amp;nbsp;&amp;nbsp; Load- metric tons (25)&lt;/P&gt;&lt;P&gt;S382_P&amp;nbsp;&amp;nbsp;&amp;nbsp; 06/18/2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90.890579&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 93&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.010426405&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have suggestions on how I can read in this type of data so that the station name is associated with the data?&amp;nbsp; Please let me know.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 22:21:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/208715#M41928</guid>
      <dc:creator>KPietro</dc:creator>
      <dc:date>2019-05-16T22:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/208725#M41929</link>
      <description>If you use the Excel Wizard, it is a simple matter to do this.  In JMP, go to&lt;BR /&gt;     File==&amp;gt;Open&lt;BR /&gt;Then navigate to the location of the Excel spreadsheet.&lt;BR /&gt;Click once on the file you want to read in, to highlight it.&lt;BR /&gt;Then go to the lower left area of the navigation window, and click on the drop down arrow next to Open.&lt;BR /&gt;Select "Use Excel Wizard"&lt;BR /&gt;In the Wizard, you will be able to select the row that has the column headers(6)&lt;BR /&gt;and the row where the data start(7)</description>
      <pubDate>Thu, 16 May 2019 22:29:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/208725#M41929</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-05-16T22:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/209059#M41995</link>
      <description>&lt;P&gt;Jim, the instructions provided are OK if all data is contained in separate columns but I have a different file layout.&amp;nbsp;In the attached file, you will see that&amp;nbsp;the station name appears only a single time in &lt;STRONG&gt;Row 1&lt;/STRONG&gt;, while the headers start in &lt;STRONG&gt;Row&amp;nbsp;7&lt;/STRONG&gt; and the data in &lt;STRONG&gt;Row 8.&lt;/STRONG&gt;&amp;nbsp; The station names are "stacked" on top of the data headers and columns. &amp;nbsp;Please let me know how I can read in the station name, then associate that station name to the appropriate header/data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the attached example file, data is listed for 4 stations and the names of these stations&amp;nbsp;are found in the Excel file addresses: A1, I1, Q1, Y1 (highlighted in yellow).&amp;nbsp; For the first station in the file, the station name is S382_P (found in A1), and the data for that station is found in columns A - H (header starts in Row7 and data on Row8); the second station is&amp;nbsp;S382_C (found in I1) and the data for that station is found in columns I -&amp;nbsp;P, etc.&amp;nbsp; I would like to have the imported data to look like this when I make it a JMP datafile:&lt;/P&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Flow-acft&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Concentration-ug/L (25)&amp;nbsp;&amp;nbsp; Load-metric tons (25)&amp;nbsp;&amp;nbsp; &lt;EM&gt;more colums .&amp;nbsp;. . &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;S382_P&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;06/18/2015&amp;nbsp;&amp;nbsp; &amp;nbsp;90.890579&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 93&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.010426405&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 14:05:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/209059#M41995</guid>
      <dc:creator>KPietro</dc:creator>
      <dc:date>2019-05-20T14:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/209076#M41997</link>
      <description>&lt;P&gt;Sorry....I misinterpreted your original question.&amp;nbsp; Below is a script that works with the sample data table you provided.&amp;nbsp; Just change the path in the Open() function to the path to your data table, and then run the script.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
dtOrig = Open(
	"&amp;lt;path to excel file&amp;gt;\Excel_import_example_file.xlsx",
	Worksheets( "example" ),
	Use for all sheets( 1 ),
	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( 1 ),
		Data Starts on Column( 1 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		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( "-" )
	)
);

// Create a new table with the Column names on row 7 from the original
dtResult = New Table("Final");
dtResult &amp;lt;&amp;lt; New Column("Name",Character);
col=1;
While(col&amp;gt;0,
	dtResult &amp;lt;&amp;lt; New Column(dtOrig[7,col]);
	If(left(dtOrig[1,col+1],5)=="Name:",col=-1);
	col=col+1;
);

// Now Populate the Table
For( col = 1, col &amp;lt;= N Cols( dtOrig ), col++,
	If( Left( dtOrig[1, col ], 5 ) == "Name:",
		dtResult &amp;lt;&amp;lt; Add Rows( 1 );
		resultCol = 1;
		Column( dtResult, resultCol)[ N Rows( dtResult ) ] = Trim( Substr( Column( dtOrig, col )[1], 6 ) );
	);
	resultCol = resultCol + 1;
	Column( dtResult, resultCol)[ N Rows( dtResult ) ] = Num( Column( dtOrig, col )[8] );
);

close( dtOrig, nosave );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="funnyExcel.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17284i7EF4671898C91BE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="funnyExcel.PNG" alt="funnyExcel.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 15:18:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/209076#M41997</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-05-20T15:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210425#M42138</link>
      <description>Thanks . . . but the script works if I have only 1 line of data. But it doesn't seem to work with multiple lines of data. Sorry, I sent a short file as an example but the data files I work with have multiple lines of data. I attached the longer version of the file to this email (pls see worksheet "example"). It would be great if you could assist me with reading in multiple lines of data.&lt;BR /&gt;[cid:image001.png@01D51188.A1E017A0]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 May 2019 21:01:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210425#M42138</guid>
      <dc:creator>KPietro</dc:creator>
      <dc:date>2019-05-23T21:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210427#M42140</link>
      <description>It looks like you might have attached an image, but for some reason it didn't work. Can you go back and edit your post to try to attach the image again?</description>
      <pubDate>Thu, 23 May 2019 21:35:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210427#M42140</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2019-05-23T21:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel data where not all the information is found in a single row or column</title>
      <link>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210433#M42143</link>
      <description>&lt;P&gt;If the multiple lines you are referring to, are additional lines after line 8, that are of the same structure as line 8, then the following script will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtOrig = Open(
	"&amp;lt;Path to File&amp;gt;\Excel_import_example_file.xlsx",
	Worksheets( "example" ),
	Use for all sheets( 1 ),
	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( 1 ),
		Data Starts on Column( 1 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		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( "-" )
	)
);

// Create a new table with the Column names on row 7 from the original
dtResult = New Table( "Final" );
dtResult &amp;lt;&amp;lt; New Column( "Name", Character );
col = 1;
While( col &amp;gt; 0,
	dtResult &amp;lt;&amp;lt; New Column( dtOrig[7, col] );
	If( Left( dtOrig[1, col + 1], 5 ) == "Name:",
		col = -1
	);
	col = col + 1;
);

For( theRow = 8, theRow &amp;lt;= N Rows( dtOrig ), theRow++, 
// Now Populate the Table
	For( col = 1, col &amp;lt;= N Cols( dtOrig ), col++,
		If( Left( dtOrig[1, col], 5 ) == "Name:",
			dtResult &amp;lt;&amp;lt; Add Rows( 1 );
			resultCol = 1;
			Column( dtResult, resultCol )[N Rows( dtResult )] = Trim( Substr( Column( dtOrig, col )[1], 6 ) );
		);
		resultCol = resultCol + 1;
		Column( dtResult, resultCol )[N Rows( dtResult )] = Num( Column( dtOrig, col )[theRow] );
	)
);
Close( dtOrig, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2019 03:08:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-Excel-data-where-not-all-the-information-is-found-in-a/m-p/210433#M42143</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-05-24T03:08:56Z</dc:date>
    </item>
  </channel>
</rss>

