NRAO Home > CASA > CASA Toolkit Reference Manual
table.toasciifmt - Function

3.2.1 Write CASA table into an ASCII format


Description

Write a table into an ASCII format approximately compatible with fromascii except that in order to permit variable shaped arrays (as they often occur in MSs), array values are output enclosed in square brackets. The separator between values can be specified and defaults to a blank. Note that columns containing invalid data or record type data are ignored and a warning is issued.

If the argument headerfile is set then the header information is written to that file instead of the first two lines of the data file.

Arguments





Inputs

asciifile

Name of ASCII file to be written

allowed:

string

Default:

headerfile

Name of an optional file defining the format

allowed:

string

Default:

columns

Names of columns to be written, default is all

allowed:

stringArray

Default:

sep

Value separator, default is one blank

allowed:

string

Default:

Returns
bool

Example

 
 
tb.toasciifmt(asciifile=’myfile3.dat’, headerfile=’myfile3.head’, columns=[’SOURCE_ID’, ’NAME’, ’PROPER_MOTION’], sep=’, ’)  
 
 
will produce a comma separated ASCII output of the three columns ’SOURCE_ID’, ’NAME’, and ’PROPER_MOTION’ in file ’myfile3.dat’  
and a format description in ’myfile3.head’.  
 
 
tb.toasciifmt(asciifile=’myfile.dat’)  
 
 
will produce a space separated ASCII output of all table columns into file ’myfile.dat’  
with the first two lines containing a format description.  

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright © 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search