3.3.2.45 Open

Open or import a data file.

Please see the impASC, impSPC, impFile X-Functions.

Syntax:

open option filename

Note: If there are spaces in fileName, enclose fileName in quotation marks " ".

Options:

-a; Import the specified file into the new columns of active worksheet

Syntax: open -a filename

Append fileName to the currently active worksheet as columns. The filename means the path of the file.

//Import the specified file into the active worksheet 
//from new column.
open -a D:\Samples\Raman Baseline450.dat;

-ar; Import the specified file into the new rows of active worksheet

Syntax: open -ar filename

Append fileName to the currently active worksheet as rows.

//Import the specified file into the active worksheet 
//from new row.
open -ar D:\Samples\Raman Baseline450.dat;

-n; Import the specified file into the named Notes window

Syntax: open -n filename [winName]

Open the specified fileName text file into the specified (optional) winName notes window.

//Open the sepcified txt file 
//in the specified Note window.
open -n C:\test.txt [Notes];

-p; Import the specified file into the active graph window and set the plotting designations

Syntax: open -p plottingDesignations fileName

Import the fileName file into the active graph window. Specify the plotting designations for the columns in the import file.Only X and Y (plotting designations) can be specified. If the import file is ordered as X and any number of Ys, set plottingDesignations to XY. Otherwise, explicitly specify the repeat pattern. For example plottingDesignations = XYYYXYYY.

//Add the soecified data into the Graph window as XYXY.
open -p XYXY c:\waterfall.dat;

-s; Import the given Thermo Galactic SPC data file into the new columns of active worksheet

Syntax: open -s filename or -spe filename

Import the given Thermo Galactic SPC data file into the active worksheet starting from the first empty column.(For information about files dropped into Origin, see the doc object.)

-se; Import the given Thermo Galactic SPC data file into the new columns of active worksheet without the evenly spaced X values

Syntax: open -se filename

Import the given Thermo Galactic SPC data file into the active worksheet starting from the first empty column.Do not read in the x column if x values are evenly spaced (For information about files dropped into Origin, see the doc object.)

-sn; Import the given Thermo Galactic SPC data file and replace the existing data in the active worksheet

Syntax: open -sn filename

Import the given Thermo Galactic SPC data file into the active worksheet as new data, replacing any existing data.(For information about files dropped into Origin, see the doc object.)

-w; Import the specified ASCII file into the active window

Syntax: open -w filename

Import the given ASCII file into the active window.

-wf; Import the given file into the active worksheet using the appropriate import filter

Syntax: open -wf filename

Import the given file into the active worksheet by using the appropriate import filter.The file type is determined automatically. The type of file can be WKS, WK1, WK3, WKQ, or DIF.

-we; Import the given ext file into the active worksheet by using the appropriate import filter

Syntax: open -we ext filename

Import the given file into the active worksheet by using the appropriate import filter.The type of file is specified by ext, which can be one of the following: XLS4, XLS3, XLS2, DBF4, DBF3PLUS, DBF3, or DBF2. In each case, the (file) numbers refer to the version of the software that created the file.

Examples:

The following script opens the Open dialog box to import Lotus or DIF files into the worksheet.

getfile *.WKS *.WK1 *.WK3 *.DIF *.WKQ;
open -wf %B%A;

The last script opens the Open dialog box to import an Excel file. Since these formats require special ext values in the open command options, the getnum command is used to get the version of the Excel file.

getfile *.XLS;
ver = 4;
getnum (Version {2 to 4}) ver (Excel Import);
open -we XLS$(ver) %B%A;


See Also:

LabTalk:GetFileName (command)