OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

batchProcess

Contents

Menu Information

Batch Processing

Brief Information

Batch processing with Analysis Template to generate summary report

Additional Information

Minimum Origin Version Required: 8.1 SR0, updated in 8.5.1 SR0

Command Line Usage

1. Repeatedly Import into Active Analysis Template Window

string fname$, path$="C:\Data\";

findfiles f:=fname$ e:="*.dat"; // findFiles will default to get from path$

batchProcess batch:=active fill:="Linear Fit" method:="impAsc" theme:="batchImporting" append:="FitLinearCurve1";

2. Load Analysis Template

string fname$, path$="C:\Data\";

findfiles f:=fname$ e:="*.dat";

batchProcess batch:=template fill:="Linear Fit" append:="FitLinearCurve1" name:="C:\Data\LinearFit.ogw" method:="impAsc" theme:="batchImporting";

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Batch Processing Mode batch

Input

int

1

Specify the batch processing mode.

Option list:

  • active:Repeatedly Import into Active Analysis Template Window
In this mode, Origin will repeatedly import data files to a preloaded analysis template and then send the results of each analysis process to the Output Sheet.
  • template:Load Analysis Template
In this mode, Origin will load the template for N times (N is the number of the data files which need to be processed.). Each time, it will perform analysis with the imported data file and then send the results to the Output Sheet.
Analysis Template name

Input

string

<unassigned>

This is available only when the Batch Processing Mode is set to Load Analysis Template. It can be used to specify the analysis template. You can click the Image:BatchBrowseButton.png button to find the template you want.

Data Source data

Input

int

0
Specify what kind of data source will be used.

Option list:

  • import:Import From Files
    Data will be imported from files.
  • existing:Use Existing XY Datasets
    Use existing datasets in the project.
Use Import Setting in Workbook last

Input

int

1
Specify whether to use the last data importing settings. This is available only when Data Source is Import From Files.
File List fname

Input

string

fname$
Specify the data files which will be imported into the Data Sheet. You can click the Image:BatchBrowseButton.png button to get the data files.
Input iy

Input

XYRange

<active>
This is available only when Use Existing XY Datasets has been selected from Data Source drop-down list. It specifies the xy ranges for batch processing.
Dataset Identifier id

Input

string

None
Specify whether to add a column with Long Name of "Dataset" to the Output Sheet for identifying each analysis dataset. If None, such a column will not be added. Otherwise, when Data Source is Use Existing XY Datasets, Dataset Identifier can be Range, Book Name, Sheet Name, Long Name, Units or Comments. When Data Source is Import From Files, just File Name, Long Name, Units or Comments can be chosen.
method

Input

string

ImportWizard
This can only be accessed from LabTalk scripts. Specify the method to import the data files. Options include:
  • ImportWizard
You can use Import Wizard to import the files. With this method, you need to specify a Filter to import the data files.
  • Script
You can write LabTalk scripts to import the data files.
  • All import X-Function, such as impASC, impCSV, impExcel etc.
You can specify any data importing X-Function (method:="impASC") to import data. With this method, you must specify a Theme.
theme

Input

string

<auto>
This is available only when Method is selected as an importing X-Function. Specify the theme file to import the data files.
filter

Input

string

<auto>
This is available only when Method is selected as ImportWizard. Specify a filter to import data files.
script

Input

string

<unassigned>
This is available only when Method is selected as Script. These scripts will be used to import the data files.
Data Sheet fill

Input

string

<unassigned>
Specify the source data worksheet in the analysis template.
Result Sheet append

Input

string

ToAppend
Specify analysis result sheet in the analysis template.
Output Sheet ow

Output

Worksheet

[Summary]Results!
Specify the worksheet to which results from the Result Sheet will be appended.

See syntax here.

Delete Intermediate Analysis Outputs remove

Input

int

1
Specify whether to delete the intermediate analysis outputs after the process.
Starting Row of Output Sheet number

Input

int

1
Specify the beginning row in Output sheet to append results.
Clear Output Sheet on Start clear

Input

int

1
Clear the Output Sheet when starting the process.
Append Label Rows label

Input

int

0
Specify whether to append label rows of the first Result Sheet to Output Sheet.
Script after Each Process loopscript

Input

string

<unassigned>
Scripts in this edit box will be executed after each process.
Script at the End endscript

Input

string

<unassigned>
Scripts in this edit box will be executed at the end of the whole process.

Description

This X-Function performs batch processing and generates a summary report. You should first create an analysis template, and then reuse the template in this process. This function provides options for either repeatedly importing data into the current workspace's analysis template, or for loading a previously saved analysis template.

More details, please see Batch Processing.

Examples

In this example, we will run a script to fit all files named step0*.dat:

// File path
string path$ = system.path.program$ + "Samples\Curve Fitting\";
string fname$;
// Find all files like step01.dat, step02.dat
// findFiles will default to get files from path$
findfiles f:=fname$ e:="step0*.dat";
// Specify the analysis template
string tp$ = path$ + "autofit.ogw";
// Perform batch process.
// File list is saved in fname$
batchprocess batch:=1 name:=tp$ method:="impAsc" fill:="Data" append:="Summary"