Run script even if directory changesI 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=""></DELETE>
Re: Run script even if directory changesYou could place the .jsl for conversion in the same Directory as the Excel file,
but Point to a Folder different for each user to save the .jmp file. See the example from Scripting index how to Access the DOCUMENTS Folder specific to each user.
In that way you can Control how the conversion goes from Excel to JMP, but each user has it's own JMP file to work with.
Names Default To Here( 1 );
Convert File Path( "$DOCUMENTS" );
/* try: HOME, DOCUMENTS, SAMPLE_DATA,
SAMPLE_IMPORT_DATA, SAMPLE_SCRIPTS, and TEMP */
Re: Run script even if directory changesInstead of hard-coding the path to the file, you could use the PickFile function which will allow the user to select the file.
Re: Run script even if directory changesHaving read your question again:
if you have the file in the same directory as the script then you only need to use the file name:
dt2 = Open("collection.xlsx", ...