Origin Ver. and Service Release: 8.5.0 SR0 Operating System: Windows 7
Hi,
I am trying to trim some excess data of all of the workbooks in a folder. The following script works if I run it on an individual workbook, but if I include the "doc -ef W" to make it run on all of them, it does not. I've found that this is because "range aa = [%H]1!1;" does not update with each iteration (it's always the value of the first workbook processed). Additionally, the assignment "range temps = aa[1:50];" fills temps with the same incorrect values as aa, but the calculation "fixTemp = round(mean(temps),0);" gives the correct result. Thanks for your help!
Nick
doc -ef W { del -al aa; range aa = [%H]1!1; range temps = aa[1:50]; fixTemp = round(mean(temps),0); lastrow = aa.nrows; type "$(fixTemp)"; type "$(aa(1)) $(aa(2)) $(aa(3))"; type "$(temps(1)) $(temps(2)) $(temps(3))$"; for(ii=1;ii<=aa.nrows;ii++){
//type "$(ii)"; //type "$(aa(ii))";
if (abs(fixTemp-aa(ii))<0.5) continue;
lastrow = ii; break; }; type "$(lastrow)"; type "$(aa.nrows)"; range toDel = [%H]1!1[lastrow:aa.nrows]; mark -d toDel; sec -p 10; }; |