| tdump | tables | tdump |
tdump -- Convert an STSDAS table to ASCII format.
tdump table
This task converts an STSDAS table to ASCII format. The output does not include row numbers or column names; use the tprint task for more readable output.
The two primary uses for tdump are to allow editing that would be difficult or impossible with tedit (such as global substitutions) and copying a table over a network to another computer. For such purposes the table can be dumped to three separate files (i.e., one containing column definitions, one for header parameters, and one for table data), the data may be edited, column data types changed, etc., and then the tcreate task can be used to reassemble the table from the three ASCII files. To prevent loss of information due to truncation, floating point data are printed using g format with a wide field. A character value with multiple words is printed with enclosing quotes to make it clear that it is the value for a single column and also for compatibility with tcreate.
All rows and columns of the table are dumped by default, but ranges of rows and individual columns may be specified.
The order of printing the data is as follows. The first column of the first row is printed, then the second column of the first row is printed, then the third column of the first row, etc. If any column contains arrays, each element of the column array in the current row is printed before moving on to the next column. If the printed output is wider than a page (see pwidth), the output will consist of more than one line per row of the table. After printing all columns in the first row, the second row is printed in the same way. Each row begins with a new line in the output text file. Note that this can be different from tprint, which prints all rows for those columns that will fit on a page, then prints all rows for the next set of columns.
The tlcol task (with the nlist parameter set to 1) may be used to generate a list of column names so there is no question about spelling. This list may be edited to rearrange or delete columns.
If any column to be printed is wider than pwidth, a warning message will be displayed, and the data will overflow the page width. The width of each character column is increased by two to allow space for a pair of enclosing quotes, which will be used if the value to be printed includes a blank or tab.
1. Dump the table "junk.tab" to STDOUT:
tt> tdump junk.tab cdfile=STDOUT pfile=STDOUT datafile=STDOUT
2. Dump "junk.tab", but with the order of the columns rearranged:
tt> tlcol junk.tab nlist=1 > colnames.lis
tt> edit colnames.lis
(Rearrange the column names and perhaps delete some of them.)
tt> tdump junk.tab columns=@colnames.lis
3. Dump only the first 100 rows of the file "big.fits":
tt> tdump big.fits rows="1-100"
This task was written by Phil Hodge.
tprint, tlcol, tcreate, ranges
Type "help tables opt=sys" for a higher-level description of the tables package.