Choose Language Hide Translation Bar
Highlighted
Theresa
Level III

how can i save a JMP file as a name with time string?

 

how can i save big class.jmp as a name with time string? Thanks

e.g. dt = Open("$SAMPLE_DATA/big class.jmp");

 

Hope the script can identify the work week, and the day of week and add automatically on the name, thanks

 

Result i want:

save name as:

big class-ww12.1

big class-ww12.4

big class-ww12.5

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Theresa
Level III

Re: how can i save a JMP file as a name with time string?

thank you so much. And would you check the question related with "Day" calculation?

View solution in original post

Highlighted
txnelson
Super User

Re: how can i save a JMP file as a name with time string?

Route="C:\Users\ywu64\Desktop\1\test data\";
 
dt << save(
Route || "New Data-" ||
Char( Week Of Year( Today() ) ) || "." || Char( Day Of Week( Today() ) ) ||
".jmp"
);

You need to study and learn the code.  Making the change from my original code to this version requires no new information. 

Jim

View solution in original post

5 REPLIES 5
Highlighted
txnelson
Super User

Re: how can i save a JMP file as a name with time string?

All that has to be done, is to concatenate together the elements of the name that you want in the saved name

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << save(
	"$TEMP/" || Char( dt << get name ) || "-" ||
	Char( Week Of Year( Today() ) ) || "." || Char( Day Of Week( Today() ) ) ||
	".jmp"
);
Jim
Highlighted
Theresa
Level III

Re: how can i save a JMP file as a name with time string?


Thanks a lot. May i ask if i want to save to below location and change a the csv file name to "new data", what should i do ? (final data name as "new data").

Location variables:
Route="C:\Users\ywu64\Desktop\1\test data\";

What should i do to change the name? and don't use big data any more.
Highlighted
txnelson
Super User

Re: how can i save a JMP file as a name with time string?

Route="C:\Users\ywu64\Desktop\1\test data\";
 
dt << save(
Route || "New Data-" ||
Char( Week Of Year( Today() ) ) || "." || Char( Day Of Week( Today() ) ) ||
".jmp"
);

You need to study and learn the code.  Making the change from my original code to this version requires no new information. 

Jim

View solution in original post

Highlighted
Theresa
Level III

Re: how can i save a JMP file as a name with time string?

thank you very much, hope you have a lovely day.:)
Highlighted
Theresa
Level III

Re: how can i save a JMP file as a name with time string?

thank you so much. And would you check the question related with "Day" calculation?

View solution in original post

Article Labels

    There are no labels assigned to this post.