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
 Origin Forum
 Handling multiple sheets in a workbook
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mitsous

5 Posts

Posted - 01/05/2016 :  08:56:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9 and Service Release (Select Help-->About Origin):
Operating System: Win 7

Hello and happy new year. I' m new in origin and forum as well and my problem is:

I have two sets of 300 measurement files of two columns each i.e
Device1: 300 files of two columns each ...col1 for voltage and col2 for capacitance

Device2: 300 files of two columns each ...col1 for voltage and col2 for capacitance

I need to subtract for each sheet the capacitance of the two devices. I was trying to build a loop to copy to a new workbook the columns of capacitance for both devices so to make a workbook with 300 sheets but no luck...Any ideas?
Thanks

jasonzhao

China
262 Posts

Posted - 01/06/2016 :  04:55:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Would you please further explain about the process?
I think you want to:
1. Import all the files into a workbook with 300 sheets
2. Make data process, which is subtract for each column in sheet the capacitance of the two devices
3. The capacitance of the two devices is a const number.
Is that the procedure?


Best regards!
Jason
OriginLab Technical Service
Go to Top of Page

mitsous

5 Posts

Posted - 01/06/2016 :  11:11:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the quick answer..
The process is this:

1) Import 2 workbooks of 300 sheets each corresponding to measurements of two devices. Each sheet has 4 columns, voltage, capacitance, time
and capacitance derivative with respect to voltage. I have already built those two workbooks with the template method.

2) From these two workbooks I need to make a new workbook with 300 sheets and in every sheet must have 3 columns, time, capacitance derivative of device 1 and capacitance derivative of device 2.

3) For each sheet subtract the capacitance derivatives columns.

Voltage varies from -4 to 4 Volts, as well as capacitance and time. I think that first of all a colcopy routine must be done
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 01/06/2016 :  9:27:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Because Origin has a maximum sheet number in a workbook of 255;
How about make 2 new workbooks with 150 sheets each, and in every sheet have 3 columns
The process can be done by LabTalk;
Please see example below:


//create new book with 3 sheets (small number for test)
newbook name:="MyData" sheet:=3;

//loop through each sheet
doc -e lw{
// add 1 column for each sheet
wks.addCol(1);
}

//loop through each sheet in 3 books
loop(ii,1,3) {
      range rW = [MyData]$(ii)!2;
      range r1=[Book1]$(ii)!2;
	  range r2=[Book2]$(ii)!2;
//perform arithmetic operation on specific column
      rW=r1-r2;
}


Best regards!
Jason
OriginLab Technical Service

Edited by - jasonzhao on 01/07/2016 10:15:11 PM
Go to Top of Page

mitsous

5 Posts

Posted - 01/07/2016 :  2:53:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It's working!!!!
Thank you very much

one more question: which is the usage of doc -e W?
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 01/07/2016 :  10:16:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Please refer to this page for further information:

http://www.originlab.com/doc/LabTalk/ref/Document-cmd#-e_object_.7Bscript.7D.3B_Execute_the_given_script_for_all_objects



Best regards!
Jason
OriginLab Technical Service
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