Author |
Topic  |
|
IstarIBM
USA
Posts |
Posted - 11/15/2006 : 12:44:55 AM
|
Origin Version: 7.5 Operating System: Win XP
Hi Everybody
I have written a script to postprocess binary data after they are imported with my importfilter. One part of the script copys some cells from the new worksheet, where the data are imporeted in, to an existing worksheet. This works fine when I import several datasets into the project up to line 30 of the already existing worksheet. When I import dataset 31 into the worksheet the data are put correctly into the project, but for some reason the copiing of the cells into the already existing worksheet doesen't work correctly, some cells where put all old cells get disorderd.
Enclosed are the crucial parts of my code. It would be great if anyone has a suggestion for my. // %F is the name of the dataset with several . in it. win -a summary; // count is a worksheet with only one cell, where the first empty row // of the worksheet summary is counted row=count_A[1]; enum=%[%F, #1,.]; summary_EN[row]=enum; // %M is the renamed worksheet, where the data are imported to copy -b 1 %M_A summary_RB -b row -e row; copy -b 2 %M_A summary_RA -b row -e row; copy -b 3 %M_A summary_AV -b row -e row; copy -b 4 %M_A summary_LE -b row -e row; copy -b 5 %M_A summary_P -b row -e row; copy -b 6 %M_A summary_TE -b row -e row; // TV is created in some code before summary_TV[row]=TV; count_A[1]=count_A[1]+1; // create new worksheet to import next event create.wksname$=data; create.enumWks=0; create.wks(A B); win -a data; win -z; |
|
Mike Buess
USA
3037 Posts |
Posted - 11/15/2006 : 08:01:48 AM
|
A worksheet is created with 30 rows and the copy -b command does not add new rows. Since you are copying one value at a time you can replace the copy -b commands with this...
summary_RB[row]=%M_A[1]; // this will add a row if necessary summary_RA[row]=%M_A[2]; summary_AV[row]=%M_A[3]; etc.
Alternatively, you can add a row to the Summary worksheet before setting any of its values...
set summary -er row; summary_EN[row]=enum; copy -b 1 %M_A summary_RB -b row -e row; etc.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 11/15/2006 08:10:30 AM |
 |
|
IstarIBM
USA
Posts |
Posted - 11/15/2006 : 1:03:42 PM
|
Great, that works. Thanks Mike.
PS: Shouldn't there be more rows, when I maximize the window (I read something like that origin creates rows cause there is no empty space allowed in the bottom of the window.) and especially, when I can see more rows? |
 |
|
Mike Buess
USA
3037 Posts |
Posted - 11/15/2006 : 2:00:06 PM
|
I think the problem lies with the copy -b command. Under some circumstances it can't find the new rows even though they are clearly visible.
Mike Buess Origin WebRing Member |
 |
|
|
Topic  |
|