2.7.12 expMatASC

Menu Information

File : Export : 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";

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

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 extension. User can select .dat, .txt or .csv. If the file name has an extension already, the specified extension is added unless it matches the existing extension.


Option list

  • *.dat {0}
    Export the ASCII data with .dat file extension.
  • Text File(*.txt) {1}
    Export the ASCII data with .txt file extension.
  • .csv {2}
    Export the ASCII data with .csv file extension.
  • All Files(*.*) {3}
    Export the ASCII data using specified file name (whether it has an extension or not).
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 unless All Files is chosen.
Encoding encoding

Input

int

0
Specify the encoding method of the exported file.

Option list:

  • ansi:ANSI (0),
  • utf16le:Unicode (1),
  • utf16be:Unicode Big Endian (2)
  • utf8:UTF-8 (3)
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 which always uses comma unless overridden by csvsep option.


Option list

  • tab:TAB (0)
    Use Tab for delimiter.
  • comma:, (1)
    Use comma for delimiter.
  • space:SPACE (2)
    Use space for delimiter.
  • ct:,TAB (3)
    Use comma and Tab for delimiter.
  • cs:,SPACE (4)
    Use comma and space for delimiter.
Separator csvsep

Input

int

Comma
This parameter is used when file type is CSV. It allows overriding the default separator for CSV files.


Option list

  • comma:Comma {0}
    Use comma for delimiter.
  • semicolon:Semicolon {1}
    Use semicolon 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.

  • Menu: Select File: Export: ASCII...
  • Command window: type expMatASC -d in 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