cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
djhanson
Level V

How to make JSL get file timestamp?

Anyone know of any code say utilizing the JSL DLL features to get a file's date/timestamp?  For example, get the timestamp for: "C:\mytest.jmp".  thx... dj

3 ACCEPTED SOLUTIONS

Accepted Solutions
carole
Level III

Re: How to make JSL get file timestamp?

I don't know if it's a solution for you but I propose the following jsl :

strPathFile = "C:\mytest.jmp";

//Save batch file to get date file : create DateFile.txt containing date

Save Text File(

    "C:\GetDate.bat",

    "for %%x in ("||strPathFile||") do echo datetime=%%~tx >> C:\DateFile.txt";

    );

//Launch batch file

Open("C:\GetDate.bat");

wait(1);//wait to let time running batch file

//Open DateFile.txt containing date file in a jmp data table

Open("C:\DateFile.txt",

        columns( c000001 = Character ),

    Import Settings(

        End Of Line( CRLF, CR, LF ),

        End Of Field( Comma ),

        Strip Quotes( 1 ),

        Use Apostrophe as Quotation Mark( 0 ),

        Scan Whole File( 1 ),

        Treat empty columns as numeric( 0 ),

        Labels( 0 ),

        Column Names Start( 1 ),

        Data Starts( 1 ),

        Lines To Read( All ),

        Year Rule( "10-90" )

    )

);

View solution in original post

vkessler
Level IV

Re: How to make JSL get file timestamp?

Check this out:

 

timestamp = Creation Date( filePath );

View solution in original post

TomF
Level III

Re: How to make JSL get file timestamp?

If anyone landed here like I did, looking for the other file timestamp, I was able to get it with a related function:

timestamp = Last Modification Date( filePath );

View solution in original post

4 REPLIES 4
carole
Level III

Re: How to make JSL get file timestamp?

I don't know if it's a solution for you but I propose the following jsl :

strPathFile = "C:\mytest.jmp";

//Save batch file to get date file : create DateFile.txt containing date

Save Text File(

    "C:\GetDate.bat",

    "for %%x in ("||strPathFile||") do echo datetime=%%~tx >> C:\DateFile.txt";

    );

//Launch batch file

Open("C:\GetDate.bat");

wait(1);//wait to let time running batch file

//Open DateFile.txt containing date file in a jmp data table

Open("C:\DateFile.txt",

        columns( c000001 = Character ),

    Import Settings(

        End Of Line( CRLF, CR, LF ),

        End Of Field( Comma ),

        Strip Quotes( 1 ),

        Use Apostrophe as Quotation Mark( 0 ),

        Scan Whole File( 1 ),

        Treat empty columns as numeric( 0 ),

        Labels( 0 ),

        Column Names Start( 1 ),

        Data Starts( 1 ),

        Lines To Read( All ),

        Year Rule( "10-90" )

    )

);

djhanson
Level V

How to make JSL get file timestamp?

Excellent!  That seems to do the trick:).  Thanks Carole!!!

vkessler
Level IV

Re: How to make JSL get file timestamp?

Check this out:

 

timestamp = Creation Date( filePath );
TomF
Level III

Re: How to make JSL get file timestamp?

If anyone landed here like I did, looking for the other file timestamp, I was able to get it with a related function:

timestamp = Last Modification Date( filePath );

Recommended Articles