# 6.4.8.8 Import Wizard, The Advanced Options Page

This page is only visible when you select the Specify Advanced Filter Options check box on the Save Filters page of the Import Wizard.

• Specify the action that Origin should take when you are importing files by drag-and-drop.
• Specify LabTalk script that should be run at the end of the import process.
 Note: The options will apply when you press Finish, and will be saved to filter file for future use.

## Drag and Drop Files in Graph

There are two choices:

 Do Not Plot in Graph; Open Files in Worksheet/Matrix This is the default choice. When it is selected, the data are imported into a worksheet or matrix (whichever is specified on the Wizard's Data Source page). No plot is made. All imported data columns are plotted to the layer onto which files were dropped.

## Drag and Drop Files in Workspace

Four choices are available:

• Open Files in Worksheet/Matrix. No plots are made.
• Plot Data in Graph with All Files in One Layer.
• Plot Data in Multi-panel Graph with Each File in One Pane.
• Plot Data in Multiple Graph Windows with Each File in One Graph.

## Script after Each File Imported

Type or copy LabTalk code that you want to execute at the end of the import process in this text box to run after each file is imported. The code is saved with the OIF and will execute at any time when the import filter is used. This provides an easy way to post-process data automatically at the end of the import process.

## Script after All Files Imported

Type or copy LabTalk code that you want to execute at the end of the import process in this text box to run only after all files are imported. The code is saved with the OIF and will execute at any time when the import filter is used. This provides an easy way to post-process data automatically at the end of the import process.

Example 1: You wish to swap columns 1 and 2 after importing the data. To do this, you could enter the following script:

temp=col(1);
col(1)=col(2);
col(2)=temp;
del temp;

Example 2: You wish to add column 2 to column 1, then delete column 2. To do this, you could enter the following script:

col(1)+=col(2);
del col(2);

Example 3: You wish to import multiple files as new rows, and at the end perform some operation on a particular column. To do this, you can make use of the LabTalk doc object to check for last file.

// Check if last file has been imported
// Check if last file has been imported
if( doc.dropindex == doc.dropcount )
{
// Do stats on a column for example
stats col(2);
type -a Mean value of column 2 is: \$(stats.mean);
}
 There is a quick way to load a conditional control or loop script, when you are doing script in Script after Each File Imported box or Script after All Files Imported box just like Example 3. Right click on the edit box to select Conditional/Loop at the bottom of the context menu, and then select a conditional structure or loop you desired in the flyout. The syntax will be added at cursor with simple comments.
 Note: You can also call Origin C functions and X-Functions to perform post-processing. If Origin C functions are called, they should be compiled and included in your workspace in advance.