9.1.6 Importing Multiple Files into Workbooks Cloned from Active Workbook


Origin provides a quick yet powerful way to clone current workbook/sheet when importing data, so that each new data will be imported to workbook/worksheet with same customization and analysis. This feature is implemented for most of Origin's supported import file types, e.g., ASCII, CSV, Excel, etc. This tutorial will highlight this feature with commonly used ASCII files.

What you will learn

This tutorial will show you how to:

  • Create a Prototype Workbook
  • Import Multiple Files into the Cloned Workbook

Import Multiple ASCII Files into Cloned Workbooks

Create a Prototype Workbook

In this example we will import a file and do a linear fitting with it.

  1. Start a new project. Click the Import Single ASCII button Button Import Single ASCII.png on standard toolbar.
  2. Browse to <Origin Installation Path>\Samples\Curve Fitting\ folder to select Sensor01.dat.
  3. Check Show Options Dialog checkbox and click Open button.
  4. Under the Import Options -> Rename Sheets and Books node, uncheck the Rename Sheet with (Partial) Filename box.
  5. Click OK button to finish import. You can see after import, Sheet name is still Sheet1.
  6. Highlight column B (Sensor Output) and choose Plot: 2D: Scatter : Scatter to plot a scatter graph.
  7. Double click on X axis to open the Axis dialog. Activate Scale tab. Choose both Horizontal and Vertical on left panel and set Rescale as Auto. Click OK.
  8. Choose Analysis: Fitting: Linear Fit menu to open Linear Fit dialog. Select Recalculate mode as Auto, click OK button to perform the fit. Select No radio box and click OK button in appeared prompt.
  9. Right click in gray area on Sheet 1 worksheet and choose Add Graph... context menu. Choose Graph1 and click OK. Scatter plot with linear fit curve will show as a floating graph on Sheet1.
Import Multiple Files Clone Active Workbook 02.png

In step 8., you were asked to set the Recalculate mode to Auto. Beginning with Origin 2018b, this step is not necessary as cloned imports automatically trigger recalculation. Earlier versions of Origin will behave in the same way if you put the following line of LabTalk script into Script after Each File Imported box in the Import Multiple ASCII dialog box.

run -p au;
ASCII clone run-p au2.png

Import Multiple Files into the Cloned Workbook

Now we want to import more Sensor data and do the same linear fit.

  1. Make sure Sheet1 sheet is active and click the Import Multiple ASCII button Button Import Multiple ASCII.png on standard toolbar.
  2. Select the files Sensor02.dat, Sensor03.dat from \Samples\Curve Fitting and add to lower panel of the file dialog. Keep the Show Options Dialog:<sheet> box checked and click OK. This will open a dialog for import settings.
  3. Expand Import Options node and set 1st File Import Mode and Multi-File (except 1st) Import Mode to Start New Books. To clone current workbook, select <clone> from Template Name drop-down list.
Import Multiple Files Clone Active Workbook 01.png

4. Click OK button to import multiple files. Each data file is stored in a new workbook with same analysis done as in prototype workbook.

Import Multiple Files Clone Active Workbook 03.png