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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Copying from multiple workbooks

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
koneal88 Posted - 05/23/2013 : 9:52:42 PM
I'm just starting to try out LabTalk so bear with me. What I'm trying to do is integrate all the workbooks in my project, and then copy the area into a new workbook. I have figured out how to do the integration:

doc -e LB {integ1 iy:=[%H]sheet1!(Col(A),Col(B))};

This integrates each workbook perfectly. Now I would like to take the last value from the integration column from each workbook, and output them into a new workbook in order. What I have so far is:

doc -e LB {

copydata irng:=[%H]sheet1!Col(3)[11] orng:=[OscStrength]sheet1!Col(2)[wks.ncols] }


It seems like it copies the values, but the first few overwrite each other, and the last one ends up halfway down the column. Any ideas on how I can get the data to be copied to the column by rows? I know it has to do with the specification of the rows in the output range of the copydata command.

Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:
2   L A T E S T    R E P L I E S    (Newest First)
koneal88 Posted - 05/24/2013 : 11:40:51 AM
That works wonderfully! Thank you so much!!!
greg Posted - 05/24/2013 : 09:38:38 AM
Since you want the summation you do not need the integral data. You can use the area parameter to catch the integral area. Also, the doc -e command actually changes the temporarily active book and sheet so "[%H]sheet1!" is not needed, will fail if there is no sheet1 and will never find more than the first sheet.

Here's an example that gets every sheet and leaves no integral data behind:

// BEGIN SCRIPT
newbook name:=Results option:=1; // Sets up our results sheet
range rax = 1;
range ray = 2;
row = 1; // Start at row 1
doc -e LB {
if(page.name$!="Results") // need to skip the Results book
{
integ1 iy:=(1,2) oy:=<none> area:=MyArea; // No output
rax[row]$ = %H,%(layer.name$);
ray[row] = MyArea;
row++;
}
}
// END SCRIPT

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000