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.
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;
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'