Files
From BYU Astro Docs
Contents |
Basic Information
The files command is used to expand a file name template into a list of files.
Usage / Parameters
Usage:
files template
Parameters:
template A file name template specifiying the set of files to be listed. sort = "yes" Sort the file list.
Creating file lists for Rfits, etc.
This is probably the main usage for us. Normally when creating a list filenames to use as output for filenames for Rfits you have to edit the list to replace the extensions. Using the files task you can eliminate the need to edit your output file list. For example:
files *.fit > infile.lis files *.%fit%imh% > outfile.lis
This will create two files. One can be used as the input for for Rfits (e.g. "@infile.lis"), the other can be used as the output in the same manner. See Rfits documentation in this Wiki [1] for more on this.
Examples
1. Generate a single column list of files in the current directory, sorted in ASCII collating sequence.
cl> files
2. Generate an unsorted single column list of files in logical directory "lib$". Each entry in the output list is of the form "lib$...".
cl> files lib$ sort-
3. Generate a file list to be used to make a set of new files. The new file names will be the old file names with "_1" concatenated to the root, e.g., "root.x" would map to "root_1.x" and so on.
cl> files root.*//_1
4. Generate a file list similar to that in [3], adding a directory prefix to each filename.
cl> files dir$//root.*
5. Use string substitution to change the filename extension of a set of files to ".y".
cl> files root.%*%y%
Source / Additional Information
Most of this information is taken from the IRAF documentation available by typing "help files" in IRAF.

