Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
juggernick
Posted - 06/08/2012 : 4:37:20 PM 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; };
1 L A T E S T R E P L I E S (Newest First)
Sam Fang
Posted - 06/11/2012 : 07:27:36 AM It's a known bug in 8.5. We have fixed it in 8.5.1.