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
 Forum for Origin C
 Advanced Batch Processing

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
BryanK Posted - 02/12/2014 : 08:08:27 AM
Origin Ver. and Service Release (Select Help-->About Origin): 9
Operating System:Windows 7x64

Good afternoon,
With my beginning skills in Origin, I have been able to make a template that allows me to batch import csv files with a certain format. I am missing a few features that may require code.

1) Where can I plant code in a template file to add more features?

2) What code can I try to copy the name of a worksheet (i.e. "Sheet1") to the name seen in Project Explorer for that book?

3) What code can I try to copy a slope value from a "Linear Fit; Parameters" table to a Summary book containing values from each batch file?

Thank you in advance for any suggestions,
~Bryan~
2   L A T E S T    R E P L I E S    (Newest First)
BryanK Posted - 03/17/2014 : 12:56:27 PM
Hi Greg. Thanks for replying!
1) Right now I have one .opj file with raw data and columns with calculated formulae/graphs. Then I use a SaveTemplateAs command generating a .ogw file. With BatchProcessing... , I think it replaces the raw data for each csv file with this workbook template.

2) The first worksheet of each workbook always contains the name. Where would I feed the code lines you suggested? Into what window?

3) I tried range r2 = 2!Col(14); in the BeforeFormula Scripts with Col(x)= r2 because I don't quite know how to work with the code you suggested (yet!). I think it works.

Thanks again for responding
greg Posted - 02/13/2014 : 12:34:55 PM
It isn't clear from your post what's driving the batch import and how a template is involved so I cannot address question 1.

Question 2 is problematic. Project Explorer only shows Child Windows in Origin. A Workbook is an example of a Child Window, but it may contain more that one Worksheet and that information is not displayed in Project Explorer. For the special case of a Workbook containing only one Worksheet, you could set the Workbook Long Name to show the sheet name or some combination, as in:
page.label$ = layer.name$; // Long name has only sheet name
page.label$ = [%H]%(layer.name$); // Long name use formal range notation
You can decide what to show as the page Title:
page.title = 1; // Show just Long Name
page.title = 3; // Show both Short and Long Names

For question 3, you should use the getresults X-Function as follows:
// For Book3 with Report Sheet Linear Fit of Sheet1 C
getresults tr:=mytr iw:=[Book3]"Linear Fit of Sheet1 C"!;
slope = mytr.Parameters.Slope.Value;
ty Value of slope is $(slope);

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