rcardimage: Convert a cardimage file into a text file

Package: dataio

Usage

rcardimage cardfile file_list textfile

Parameters

cardfile
The cardimage source file. Cardfile may be either a template specifying a list of disk files, e.g. card* or a mag tape file specification of the form mtl*[n], where mt stands for mag tape, l stands for a specific drive, * stands for the density and [n] is the tape file number. If no tape file number is specified then the tape file numbers are taken from the file_list parameter.
file_list
A list of tape file numbers or ranges delimited by commas, for example "1,3,5-8", which is used only if the magtape device is specified. Files will be read in ascending order, regardless of the ordering of the list. Reading will terminate silently if EOT is reached, thus a list such as "1-999" may be used to read all files on a tape.
textfile
Name of the output file. If multiple input files, multiple output files will be generated by concatenating the tape file number or disk sequence number onto the textfile string.
card_length = 80
The number of columns per card in the input card image file. Must be divisible by the number of bytes per "IRAF character" (2 on most machines). The task reblock can be used to pad files with odd-sized cards.
max_line_length = 161
The maximum line length to be generated. Default is maximum size of a line permitted by IRAF. Useful for stripping columns 73-80 from Fortran card image files.
entab = yes
Replace blanks with tabs and blanks. Tabsize is 8.
join = no
Rejoin oversize lines.
contn_string = ">>"
Marker to enable program to recognize oversize lines.
trim = yes
Trim trailing whitespace from each line.
verbose = yes
Output messages listing files created, number of cards processed, etc.
ebcdic = no
Translate from ebcdic to ascii.
ibm = no
Translate from ibm ebcdic to ascii.
offset = 0
Integer parameter specifying the tape file number offset. For example if offset = 100, card_file = "card" and file_list = "1-3", the output file names will be "card101", "card102" and "card103" respectively, instead of "card001", "card002" and "card003".

Description

Multiple cardimage files are read from disk or tape. If only the magtape device is specified, a list of file numbers is requested. In the latter case, output files have the form root_filename // tape(disk)_file_number. By default, trailing whitespace is trimmed from each line.

Examples

1. Convert a set of ASCII cardimage files on magnetic tape to IRAF text files, replacing blanks with tabs and blanks, and trimming whitespace from the ends of lines.

cl> rcardimage mtb1600 1-999 textfiles

2. Convert a set of ASCII cardimage files on disk to IRAF test files.

cl> rcard card* 1 textfiles

3. Convert a set of EBCDIC cardimage files on magnetic tape to IRAF text files, trimming whitespace from the ends of lines but leaving embedded blanks unchanged.

cl> rcardimage mtb1600 1-999 textfile en- ebc+

4. Convert an odd-blocked (81 bytes per card) rcardimage file on tape to an IRAF text file by using reblock to write the file to disk and pad the cards with blanks, followed by rcardimage to convert the file to an IRAF textfile.

cl> reblock mta[1] cardimage inrecord=81 outrecord=82 \
    padchar=" "
cl> rcardimage cardimage 1 textfile card_length=82

Bugs

Due to portability considerations The card length in bytes must fill an integral number of IRAF characters. On most machines this means that the length of the card must be an even number of bytes . The task should be generalized to require only that the tape record length be specified to read odd blocked card image files.

The size of the output text file lines is currently restricted to 161 or fewer characters.

See also

wcardimage