cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Hobbi
Level II

JSL help: How can I open an excel spreadsheets and delete duplicates?

I have my script (from the excel import wizard) as well as the example attached. All those columns are there but I just removed the data. 

 

I am mainly looking to open an excel spreadsheet and only keep columns B and C while also deleting duplicate rows. I keep getting errors when debugging that the  Hobbi_0-1635365476937.png

This is my script so far. I don't have a duplicate delete portion because I keep trying to deal with this error. 

 

All the spreadsheets I intend to open have the same format as the attached one. Thank you!

 

Clear Symbols();

names default to here(1);

path = Pick File ();

dt = Open(
	path,
	Worksheets( "Sheet1" ),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 2 ),
		Data Starts on Column( 2 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 3 ),
		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( "-" )
	)
	
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
Thierry_S
Super User

Re: JSL help: How can I open an excel spreadsheets and delete duplicates?

Hi,

Your Excel file does not contain the worksheet named "Sheet1" (it is called "Data" instead). Hence, JMP cannot open the file. If all your Excel files look the same, just change the value of the Worksheets variable in your script to "Data".

Best,

TS

Thierry R. Sornasse

View solution in original post

2 REPLIES 2
Thierry_S
Super User

Re: JSL help: How can I open an excel spreadsheets and delete duplicates?

Hi,

Your Excel file does not contain the worksheet named "Sheet1" (it is called "Data" instead). Hence, JMP cannot open the file. If all your Excel files look the same, just change the value of the Worksheets variable in your script to "Data".

Best,

TS

Thierry R. Sornasse
Hobbi
Level II

Re: JSL help: How can I open an excel spreadsheets and delete duplicates?

Oh man - something so simple. Thank you very much!