<?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 skip a particular worksheet while importing an Excel file? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460877#M70586</link>
    <description>&lt;P&gt;Here is a short script to discard any Data Table with a name containing "Summary:&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);

tb_list = Get Data Table List ();

for (i = 1, i &amp;lt;=  N Items (tb_list), i++,

	tb_name = tb_list [i] &amp;lt;&amp;lt; Get Name;
	
	if (contains(tb_name, "Summary"), Close (tb_list[i],NoSave))


);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then rerun the&amp;nbsp;Get Data Table List () command and concatenate the remaining tables into a new data table.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Feb 2022 21:12:57 GMT</pubDate>
    <dc:creator>Thierry_S</dc:creator>
    <dc:date>2022-02-14T21:12:57Z</dc:date>
    <item>
      <title>How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460689#M70577</link>
      <description>&lt;P&gt;Hello JMP Forum,&lt;BR /&gt;I'm using JMP 16. I'm looking for a way to import an Excel spreadsheet with several worksheets, but want to skip importing a particular worksheet named 'Summary'.&amp;nbsp;Is there a way to write a script for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note: I create a report using such an Excel file periodically. And the number and names of the worksheets (other than 'Summary') vary every time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:10:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460689#M70577</guid>
      <dc:creator>klm123</dc:creator>
      <dc:date>2023-06-09T18:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460852#M70583</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;A simple "dirty" way to handle this would be to open all worksheets, record the names of all open tables [ Get Data Table List()], and discard the table with name == "Summary", [Close (dt, NoSave)].&lt;/P&gt;
&lt;P&gt;Let us know if you need an actual example of a script to assemble these commands?&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 20:26:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460852#M70583</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2022-02-14T20:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460853#M70584</link>
      <description>&lt;P&gt;Thanks Thierry!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not much familiar with using List(), so an example script would be helpful :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My plan is to concatenate the rest of the worksheets (excluding 'Summary').&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 20:39:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460853#M70584</guid>
      <dc:creator>klm123</dc:creator>
      <dc:date>2022-02-14T20:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460877#M70586</link>
      <description>&lt;P&gt;Here is a short script to discard any Data Table with a name containing "Summary:&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);

tb_list = Get Data Table List ();

for (i = 1, i &amp;lt;=  N Items (tb_list), i++,

	tb_name = tb_list [i] &amp;lt;&amp;lt; Get Name;
	
	if (contains(tb_name, "Summary"), Close (tb_list[i],NoSave))


);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then rerun the&amp;nbsp;Get Data Table List () command and concatenate the remaining tables into a new data table.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 21:12:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460877#M70586</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2022-02-14T21:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460921#M70590</link>
      <description>&lt;P&gt;Hi Thierry,&lt;/P&gt;&lt;P&gt;This is working -- discarding the "Summary" datatable. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm making some mistake in using the for() loop for concatenating. Sharing my code below. Would appreciate your guidance here&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);

xlfid = Pick File(
	"Select the Excel File",        //prompt
	"$Documents",          //starting path
	{"Excel Files|xls;xlsx", "Excel Files|*"},   //file types
	1,
	0,
	""
	);
	
dt = Open(xlfid,
	//Worksheets(),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 7 ),  // First seven rows are headers
		Headers Start on Row( 1 ),
		Data Starts on Row( 13 ),  // Data starts on row 13
		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( 1 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "_" )
	)
);
&lt;BR /&gt;// Identifying and closing 'Summary' datatable
tb_list = Get Data Table List ();

for (i = 1, i &amp;lt;=  N Items (tb_list), i++,

	tb_name = tb_list [i] &amp;lt;&amp;lt; Get Name;
	
	if (contains(tb_name, "Summary"), Close (tb_list[i],NoSave))


);
&lt;BR /&gt;// (1) Concatenating in to single datatable 'my_dt'.&lt;BR /&gt;// (2) Closing individual datatables.&lt;BR /&gt;
tb_list = Get Data Table List ();

for (i = 1, i &amp;lt;=  N Items (tb_list), i++,

	my_dt = Data Table( tb_list [1] ) &amp;lt;&amp;lt; Concatenate(
	Data Table( tb_list [i+1] ),
	Create source column,&lt;BR /&gt;    Close (tb_list[i],NoSave)
	)
	);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Feb 2022 00:32:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460921#M70590</guid>
      <dc:creator>klm123</dc:creator>
      <dc:date>2022-02-15T00:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460952#M70594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Try replacing the last part of your script with the following snippet:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tb_list = Get Data Table List ();

for (i = 1, i &amp;lt;=  N Items (tb_list), i++,
	
	if(i == 1, 	my_dt = tb_list [i],
				concatenate(Data Table (my_dt), Data Table (tb_list[i]), "Append to first table")	
	)
	
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of note, the script snippet above works well as is, but it does not work correctly if you add the switch "Create source column" because each round of concatenation creates new columns resulting in a jumble of table identifier&lt;/P&gt;
&lt;P&gt;.Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 06:10:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460952#M70594</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2022-02-15T06:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460954#M70596</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;After reviewing your script, I think there is a much more direct approach to reach the same solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here (1);

xlfid = Pick File(
	"Select the Excel File",        //prompt
	"$Documents",          //starting path
	{"Excel Files|xls;xlsx", "Excel Files|*"},   //file types
	1,
	0,
	""
	);
	
dt = Open(xlfid,
	//Worksheets(),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 1 ), //CONCATEMATE IS ON
	Create Concatenation Column( 1 ), //CREATE CONCAT COLUMN IS ON
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 7 ),  // First seven rows are headers
		Headers Start on Row( 1 ), 
		Data Starts on Row( 13 ),  // Data starts on row 13
		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( 1 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "_" )
	)
);

dt &amp;lt;&amp;lt; Select where (contains(:Source Table, "Summary"));

dt &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sorry for the convoluted route I took to get to this simpler approach.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 06:30:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/460954#M70596</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2022-02-15T06:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip a particular worksheet while importing an Excel file?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/461131#M70612</link>
      <description>&lt;P&gt;Thank you, Thierry! This is great!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 19:57:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-skip-a-particular-worksheet-while-importing-an-Excel/m-p/461131#M70612</guid>
      <dc:creator>klm123</dc:creator>
      <dc:date>2022-02-15T19:57:32Z</dc:date>
    </item>
  </channel>
</rss>

