Origin Ver. and Service Release: 9.0.0G SR2 b87
Operating System: Win7x64
Hey everybody,
it has been some years since I last asked for some help here at the originlab forum. But today I'm stuck in a -most probably- very simple coding problem, again.
Basically, I want to import the four data files named "Messwerte----CHAx CAL" via the import wizard.
Then I have to extract column 3 from those files into a new workbook ("Zusammenfassung" or results) and label the copied data according to the number of the data file ("Messdose 1" to "Messdose 4" in the comment line). The time stamp in column A(X) is copied only once from any file. When I do that manually, it looks like the following:
But as I have some hundreds of data files, I need a script that produces the results workbook automatically. I used to implement some Labtalk script at the end of the import wizard where you can set advanced filter options. There I put the following code to be run after each single imported file:
%R=%H; // Store workbook name.
%T="Zusammenfassung Zugkraefte"; // Define window name for tensile force results.
itest=exist(%T);
if (itest==2)
{
win -a %T; // Activate tensile force Results Window.
wks.addCol(); // next column
nn=wks.nCols;
wks.col$(nn).type=1; // Make data in col(nn) type Y.
}
else {
newbook name:= "Zusammenfassung Zugkraefte"; // Create tensile force results workbook.
nn=wks.nCols;
}
Col($(nn))[L]$="Zugkraft";
Col($(nn))[U]$="kN";
Col($(nn))[C]$="Messdose"$(nn-1);
range rr=[%R]1!Col(3), tt=[%T]1!Col($(nn)); // Assign datasets for copying using range notation. Copy column 3 (tensile force) from source file CALx to Col(nn) in %T
colcopy irng:=rr orng:=tt; // Copy Y data.
The result is this with several errors:
The errors are:
- Longname, Unit and Comment are written in every CHAx-file except in CHA1 (should only be written in "Zusammenfassung" workbook)
- in all CHAx workbooks "Messdose 1" is written as comment: at least it should be number 1 to 4 - but still incorrect as mentioned above
- only y-values of CHA4 have been written to the generated "Zusammenfassung" workbook and labeled incorrectly with "Messdose 1" instead of "Messdose 4"
Does anyone of you has an idea where the error is in my code? I don't get it after several hours of bug-chasing
Here are the data files:
http://www.originlab.com/ftp/forum_and_kbase/Images/data-files.zip
The import filter file .oif
http://www.originlab.com/ftp/forum_and_kbase/Images/Spider-Rohdaten-Import.zip
Thank you all in advance for your support!
Boris