T O P I C R E V I E W |
dafay |
Posted - 03/11/2002 : 4:29:31 PM I am using Origin 5.0. I wish to automate the import of ASCII data, which involves detecting the end of the data that has been imported into a Worksheet. Detecting the end of numerical data is required because the ASCII files contain varying numbers of data points.
I have tried using script such as follows, but don't know what to test for to find the end of my numerical data:
ii=1; get data1_a -e numPoints; repeat $(numPoints) { if (data1_a[ii]="what do I put here?") set data1_a -er ii-1; else ii++; };
A typical transition from numerical to non-numerical data is illustrated by the following 8 data points: 5556 5556 5554 5555 -- -- -- --
I have tried testing for the string "--", but either I've got the syntax wrong, or am testing for the wrong thing.
Any suggestions would be appreciated.
|
5 L A T E S T R E P L I E S (Newest First) |
rtoomey |
Posted - 03/15/2002 : 10:22:11 AM Thanks for the heads up! It turns out the script driving the forum crashed. The problem has been corrected.
Ryan Toomey OriginLab Corporation
|
dafay |
Posted - 03/14/2002 : 2:35:56 PM FYI Moderator: While trying to post a reply to this thread, I kept receiving an OVERFLOW error and each time I tried to correct the error and repost I'd see another posting entry. I tried deleting the redundant posts but only received further error messages: Microsoft VBScript runtime error '800a0006'
Overflow: 'cint'
/forum/inc_functions.asp, line 890
Edited by - dafay on 03/14/2002 14:44:29 |
dafay |
Posted - 03/14/2002 : 2:35:22 PM Thanks for the suggestion, but it did not produce the hoped for results. A solution may be academic at this point. I solved my issue by first creating a worksheet template that Terminates Import (see ASCII Import Options) when non-numeric data is found, then I begin my import operation by creating a worksheet from that template as in the following code: win -t data TC; getfile *.dat; open -w %A;
Were TC is the name of the worksheet template.
|
dafay |
Posted - 03/14/2002 : 2:34:04 PM error
Edited by - dafay on 03/14/2002 14:39:19 |
cpyang |
Posted - 03/11/2002 : 6:27:42 PM try if (data1_a[ii]==0/0) { set data1_a -er ii-1; break; }
|