STScI Logo

tchtype stsdas.sobsolete



tchtype -- Change table type.


tchtype intable outtable type


This task is used to change the type of one or more tables, for example from column ordered to row ordered.

NOTE: Do not use this task to convert to or from a FITS table if the output is just a directory name. This is due to the limitations on file names of FITS files. Use tcopy, stwfits or strfits.

Column ordering is a special format that can be more efficient in tasks that were written specifically for this format. If general purpose tasks such as tedit or stwfits are to be used on a table, row ordering is preferable. This is because most tasks that operate on tables access the values row by row. If a table is column ordered and large, these tasks may execute very slowly due to excessive I/O. In this situation, it may be that the fastest way to execute the task is to first convert the table to row ordering. tchtype reads column ordered tables column by column (unless there are more columns than rows), so it can copy a column ordered table to row ordered relatively efficiently. After conversion, other tasks will operate efficiently on the row ordered table.

Another option is that the output table be a text file.

A future application for this task is to convert tables to a machine independent format. This option is not yet available.


intable [file name template]
The names of the input tables.
outtable [file name template]
The names of the output tables, a directory name or null. If outtable is null or blank, the input tables will be modified in-place. If outtable is a directory name, the input tables will be written to that directory, and their names will be preserved. The output directory must be different from the directory containing the input tables.
type = "row" [string, allowed values: row | column | text]
This parameter specifies whether the output table data are organized in row order or in column order. Row order is recommended. You can also specify that the output be a text table.
(duplicate = yes) [boolean]
If the input table is already the type specified by type, the default is to copy the table anyway. One case where this is useful is when there are many input tables, and the output is a directory name, so that all the tables will be copied to the target directory.

If duplicate = no, a warning message will be printed for each input table that is already of type type, and that table will not be copied. This would be appropriate when modifying tables in-place.

(verbose = yes) [boolean]
The default is to print the names of the input and output tables as they are being copied. The actual file names are printed, including directory and extension. The names are printed as processing begins, rather than after completion.
(Version = "31August1994") [string]
Date of installation of current version.


1. Convert table "" to row ordered, putting the output in "".

	pl> tchtype bs bsr row

2. Convert all tables in the current directory to row ordered, putting the output in subdirectory "new". A warning message will be printed for all files that are not tables, and those files will not be copied.

	pl> tchtype * new row

3. Convert all tables in the current directory to row ordered. Any table that is already row ordered should not be modified; column ordered tables will be modified in-place.

	pl> tchtype *.tab "" row duplicate=no

4. Convert the text table "bs.txt" to a row ordered binary table.

	pl> tchtype bs.txt row



This task was written by Phil Hodge.


Use tcopy to convert to or from a BINTABLE extension in a FITS file. You can also use stwfits to write a table into a FITS file or strfits to read a table from a FITS file.

Source Code · Package Help · Search Form · STSDAS