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

expMatASC

Contents

Menu Information

ASCII

Brief Information

Export matrix data as ASCII file

Command Line Usage

1. expMatASC path:="c:\signal";

2. expMatASC type:=all path:="c:\signal";

3. expMatASC type:=dat path:="c:\signal" separator:=comma;

4. expMatASC im:=[mbook1]1!1 path:="c:\signal";

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix im

Input

MatrixObject

<active>

The matrix object to be exported. By default, it is the active matrix object.

File type type

Input

int

dat

Specify the exported file type. User can select .dat, .txt or .csv. If .csv is selected, quotes are added to protect cell contents.
Option list

  • *.dat
    Export the ASCII data as .dat file.
  • Text File(*.txt)
    Export the ASCII data as .txt file.
  • .csv
    Export the ASCII data as .csv file.
  • All Files(*.*)
    Export the ASCII data as any file format you specify.
File path path

Input

string

fname$

Specify the path and filename of output file.

If the file extension is omitted, it will be automatically appended according to the file type that is chosen.

Separator separator

Input

int

tab

Specify the character used as separator or delimiter. This control is not available when File Type is set to CSV.


Option list

  • TAB
    Use Tab for delimiter.
  • ,
    Use comma for delimiter.
  • SPACE
    Use space for delimiter.
  • ,TAB
    Use comma and Tab for delimiter.
  • ,SPACE
    Use comma and space for delimiter.
Export with full precision precision

Input

int

1

Specify whether data should be exported with full precision. The default value is true.

Export missing values as "--" missing

Input

int

1

Specify whether to export missing values as the "--" string. The default value is true.

Export XY Coordinates xygrid

Input

int

0

Specify whether to export the XY coordinates of the matrix.

Description

The expMatASC function exports matrix data as ASCII file. It can be accessed from menu or command window.

The output formats include .dat, .txt and .csv. You can also specify the separator and other export options according to your need.

Examples

The following example exports the active matrix as a text file (c:\test.txt):

1. From the Origin menu, select File: Export: ASCII. This opens the expMatASC dialog for you to tweak the export options.

2. Use the File Type drop-down list to select "Text File *.txt". Enter "c:\test.txt" for File Path. Click Ok to close the dialog.

The following script command exports the active matrix as an ASCII file (c:\test.dat) without opening the dialog:

expMatASC path:="c:\test.dat" type:=0;

Related X-Functions

expASC, expImage, impASC