Author |
Topic  |
|
neutrondude
Brunei
Posts |
Posted - 08/25/2009 : 07:24:19 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): 7.5 Operating System: XP
Dear all, I want to have a script that strips the filename of the data set (under import) and only usees the last four characeters(numbers) I have tried something like this but it doesnt work. Could you help me?
%A = page.info.system.import.filename$; // get filename %A = %[%A,#1,.]; // strip extension %A = %[%A,>%[%A]-4]; // strip all but last 4 characters win -r %H %A; // rename worksheet |
|
Laurie
USA
404 Posts |
Posted - 08/25/2009 : 09:48:56 AM
|
Try the following:
%A = page.info.system.import.filename$; // get filename %A = %[%A,#1,.]; // strip extension length = %[%A]; //length of string %A = %[%A,size-3:size]; // strip all but last 4 characters win -r %H %A; // rename worksheet delete -v length; //delete variable
OriginLab Technical Support |
 |
|
neutrondude
Brunei
Posts |
Posted - 08/25/2009 : 10:04:48 AM
|
Thanks a lot it works (after replacing "size" with "length" in the script..)!!
|
 |
|
Laurie
USA
404 Posts |
Posted - 08/26/2009 : 10:59:25 AM
|
Great. Thanks for catching my mistake.
%A = page.info.system.import.filename$; // get filename %A = %[%A,#1,.]; // strip extension length = %[%A]; //length of string %A = %[%A,length-3:length]; // strip all but last 4 characters win -r %H %A; // rename worksheet delete -v length; //delete variable
OriginLab Technical Support |
 |
|
|
Topic  |
|
|
|