I have an excel file that gets updated everyday(rows increase but column header and column no. remain intact).
I need to update the data in jmp file to make statistical analysis. For this task, I created a script to read the contents of the excel file & to update the jmp table.
I have two questions :
1) Is there a better way of doing what I am currently doing?
2) What if I want my other work colleagues to use the same script? I mean they will also have the same excel file,
but the directory will vary. What I am looking for is something like the script in MATLAB, where the script executes on the
file that is in the same directory where the script is located?
Thanks
Names Default to Here (1);
//current data table in JMP that has earlier data
cdt = Current Data Table();
//Delete all the rows in the current data table
cdt << Select All Rows()<<Delete Rows;
//Holder for the newly added data in the excel file
dt2 = Open("C:\Users\Neal\Desktop\Data collection.xlsx",
Worksheets( "Data entry" ),
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( 3 ),
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( "-" )
)
);
// Concatenate the JMP Table with the new imported data
cdt << Concatenate( dt2, Append to first table );
//Close the table that was used to import data
Close( dt2, nosave );