Subscribe Bookmark RSS Feed

How to check, in JSL, if CSV is finished exporting from other Application prior to JMP import?

jason_paquette

Community Trekker

Joined:

Jan 26, 2015

Hello,

For some of my data that I work with I have an intermediate application that is required to extract data from the data base before I can import it into JMP.

I have written a JSL script to launch said application, pull the data, export it to a CSV, and import it into JMP.

While the application is running, JMP performs a check every 15 seconds to see if the file becomes available. Once it becomes available JMP checks its file size every 15 seconds to make sure it stops changing before importing. If the file stays the same size X times in a row, then I start the CSV import.

The reason I have to check file size is because the files are often large and do not immediately export from the intermediate application.

Is there a less-clunky way to check if the file has finished exporting?

My method works, but I am wondering if there is a more elegant way to do it.

Thank you,

Jason

4 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

In the past, I have put the burden on the extraction program.  The extraction pgm creates a csv file of some name, but once it has completed, it renames the csv file to the name that I am checking for.  Since the rename takes virtually no time to execute, you end up only getting a fully extracted file.

Jim
jason_paquette

Community Trekker

Joined:

Jan 26, 2015

That is a clever solution, unfortunately, I cannot modify the extraction program's function to rename files. I will see if this kind of functionality could be added, as it would make for a simple solution.

Is there some kind of file flag available to JMP that can check if a file is active or not?

Craige_Hales

Staff

Joined:

Mar 21, 2013

runprogram(executable("notepad"),readfunction("text"));print("done editing");

this won't run the print until notepad is closed.

Craige
Justin_Chilton

Joined:

Aug 27, 2015

Could you provide the JSL that you are currently using to launch the application that creates the CSV file?

Justin