cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Theresa
Level IV

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
Theresa
Level IV

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

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
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
Theresa
Level IV

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.
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
Theresa
Level IV

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

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

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?