TR and X Format Codes
The TR and X format codes move the current position in the record to the right.
The syntax is:
where
| n |
is the number of characters to skip (1 ≤ n). On input, n characters in the current input record will be passed over. On output, the current output position is moved n characters to the right. |
The TR or X format codes can be used to leave whitespace in the output or to skip over unwanted data in the input. For example, either
or
results in the following output:
where "b" represents a blank space.
These two format codes differ in one way. Using the X format code at the end of an output record will not cause any characters to be written unless it is followed by another format code that causes characters to be output. The TR format code always writes characters in this situation. Thus,
results in the following output:
whereas
results in the following output:
where "b" represents a blank space. The X code does not cause the blanks to be output unless there is additional output following the blanks.