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
 Working on selected Worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Thomas M

Germany
Posts

Posted - 02/24/2006 :  05:37:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version: 7.5
Operating System: W98

Hello everybody,

maybe you can help me with a hint or workaround but I've been searching the whole morning for a solution and found nothing.

I have a folder with some worksheets:

ab001.wks
ab002.wks
ab003.wks

Now I would like to run a script that takes the existing worksheets, one after each other, creates a new worksheet and transfer some numbers from one to the other, so that it looks as follows

ab001.wks
ab001_1.wks //line 1 to 20 of ab001.wks
ab001_2.wks //line 61 to 80 of ab001.wks
ab002.wks
ab002_1.wks //line 1 to 20 of ab002.wks
ab002_2.wks //line 61 to 80 of ab002.wks
ab003.wks
ab003_1.wks //line 1 to 20 of ab003.wks
ab003_2.wks //line 61 to 80 of ab003.wks

I've tried it with the "doc -ef w {script}" command, but it seems to cause a crash, because Origin seems to try to run the script also on the new created Worksheets, so that you get an endless loop.

Is there some way to include or exclude worksheets who end/begin with some signs, or create a subfolder, transfer some files so that they are seperated or something like that?

Thanks in advance

Thomas

Mike Buess

USA
3037 Posts

Posted - 02/24/2006 :  08:11:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Thomas,

Probably easiest to create a new folder for the output worksheets. The necessary LabTalk commands are in the Extended LabTalk Commands section of the programming guide.

...Another possibility is to use doc -ef to create a list of current wks names and then operate on that list.

%Z="";
doc -ef W {%Z=%Z %H};
for(ii=1; ii>0; ii++) {
%W=%[%Z,#ii]; // name of wks #ii
if(%W=="") break; // quit if no more names
win -a %W; // activate wks
// do something
};

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/24/2006 09:26:58 AM
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