The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Finding end of data in Worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dafay

USA
1 Posts

Posted - 03/11/2002 :  4:29:31 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

cpyang

USA
1406 Posts

Posted - 03/11/2002 :  6:27:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
try
if (data1_a[ii]==0/0)
{
set data1_a -er ii-1;
break;
}



Go to Top of Page

dafay

USA
1 Posts

Posted - 03/14/2002 :  2:34:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
error

Edited by - dafay on 03/14/2002 14:39:19
Go to Top of Page

dafay

USA
1 Posts

Posted - 03/14/2002 :  2:35:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

dafay

USA
1 Posts

Posted - 03/14/2002 :  2:35:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

rtoomey

USA
184 Posts

Posted - 03/15/2002 :  10:22:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the heads up! It turns out the script driving the forum crashed. The problem has been corrected.

Ryan Toomey
OriginLab Corporation

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000