STScI Logo

trename tobsolete



trename -- Rename tables.


trename intable outtable


This task is used to rename tables. The input may be a general filename template, including wildcard characters or the name of a list file (preceded by an "@" character) containing table names. The output may be either a directory specification or a list of table names. If the output is a list of tables then there must be the same number of names in the output list as there were in the input list--the names are taken in pairs, one from the input list and one from the output list.

In order to protect against accidental renaming of files other than tables, text tables may not be renamed by trename. Use rename instead.


intable [file name template]
A list of one or more tables to be renamed.
outtable [file name template]
Either a directory name or a list of output table names.
(verbose = yes) [boolean]
Display a message on STDOUT each time a table is renamed? This message will give the old and new names.


1. Rename a single table:

	tt> trename table newname
	tt> trename table ../table

2. Rename several tables:

	tt> trename table1,table2,tab67 a,b,c
	tt> trename tab*.tab a,b,c

In the latter case the extension is given explicitly in case there are other files beginning with "tab" that are not tables; there must be exactly three tables beginning with "tab" because the output list has three names.

3. Rename all tables beginning with "nite1*" to "nite1_c". The "%" characters are used to edit file names; the "%" character delimits the old string and the new string--but in this case the old string is null, so the new string "_c" is appended to each file name.

	tt> trename nite1.*.tab nite1%%_c%.*.tab

4. Use trename to move a set of tables to a new directory:

	tt> trename table*.tab directory
	tt> trename table*.tab directory$
	tt> trename table*.tab osdirectory

where "directory" is an IRAF environment variable for a directory name, and "osdirectory" is an operating system directory name (e.g., "/user/me/" in UNIX).


Text tables may not be renamed using trename.


This task was written by Phil Hodge.


rename, tcopy, tdelete

Source Code · Package Help · Search Form · STSDAS