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
 same operation for each workbook

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
lyla7779 Posted - 11/28/2014 : 5:56:41 PM
OriginPro 8
Operating System: windows xp

Hi to everyone,
I'm totally new to origin and I need a script to apply to every workbook imported in a folder.
I need to do this operation
Col(4)*(-1) for every workbook,
I kept writing this in the 'set column values' for every workbook, but it makes me lose too much time. So, can someone write me a script that works automatically changing the values in each wb?

Thanks
2   L A T E S T    R E P L I E S    (Newest First)
lyla7779 Posted - 11/29/2014 : 05:16:47 AM
Thank you! It worked! You saved me a lot of time.
cdrozdowski111 Posted - 11/28/2014 : 8:26:36 PM
Give this a try. I only have later versions of Origin, but this should work with Origin 8 as well.

1) Navigate to the folder containing the workbooks of interest.
2) Open the Script Window from the Window main menu.
3) Copy and paste the below code into the Script Window.
4) Highlight the code and press the Return key to run the script.


doc -ef LB // Loop through all individual sheets in all books in the current Project Explorer folder
{
	if (exist(%H, 2) == 0)	// This filters our Matrix sheets that may be in folder.
		continue;		// If the current item in the loop is NOT a worksheet,
					// then continue with the sheet in the folder.

	// Now multiply column 4 by -1
	col(4) = col(4)*(-1); 
}



For more information about looping through items using LabTalk,
see http://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs

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