
Contents |
ASCII
Export matrix data as ASCII file
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";
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input Matrix | im |
Input MatrixObject | |
The matrix object to be exported. By default, it is the active matrix object. |
| File type | type |
Input int | |
Specify the exported file type. User can select .dat, .txt or .csv. If .csv is selected, quotes are added to protect cell contents.
|
| File path | path |
Input string | |
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 | |
Specify the character used as separator or delimiter. This control is not available when File Type is set to CSV.
|
| Export with full precision | precision |
Input int | |
Specify whether data should be exported with full precision. The default value is true. |
| Export missing values as "--" | missing |
Input int | |
Specify whether to export missing values as the "--" string. The default value is true. |
| Export XY Coordinates | xygrid |
Input int | |
Specify whether to export the XY coordinates of the matrix. |
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.
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;