1.1;tlc (transliterate_characters), revision 1.1, 81/07/01
TLC (TRANSLITERATE_CHARACTERS) -- Replace characters.
usage: TLC from_chars [to_chars]
FORMAT
TLC from-chars [to-chars]
TLC copies standard input to standard output, substituting or deleting
selected characters. Each input character found in 'from-chars' is replaced
by the corresponding character of 'to-chars'.
TLC differs from CHPAT (CHANGE_PATTERN) in that it deals only with single
characters or ranges of characters, whereas CHPAT deals with character
strings. For example,
$ tlc xy yx
changes all x's into y's and all y's into x's, whereas
$ chpat xy yx
changes all the patterns "xy" into "yx".
ARGUMENTS
from-chars
(required) Specify existing character(s) to be replaced. You may
specify a range of characters by separating the extremes
with a dash. For example, a-z stands for the list of
lowercase letters. 'from-chars' may contain a maximum of
100 characters.
to-chars
(optional) Specify replacement characters. You may specify a range of
characters by separating the extremes with a dash. For
example, a-z stands for the list of lowercase letters.
'to-chars' may contain a maximum of 100 characters.
If 'from-chars' and 'to-chars' contain an equal number of
characters, TLC translates the first character in
'from-chars' to the first character in 'to-chars', and so
forth.
If 'from-chars' contains more characters than 'to-chars',
TLC repeats the last character in 'to-chars' until
'to-chars' is as long as 'from-chars'. However, in the
output, adjacent repetitions of the last character appear
as one character. (See example 2 below.)
If 'to-chars' contains more characters than 'from-chars',
the extra characters are ignored.
Default if omitted: delete all occurrences of characters
in the 'from-chars' list.
EXAMPLES
The following examples show TLC's operation using standard input and output.
The first line following the command line is an echo of standard input. The
next line is the TLC results, then another line of input, then more results,
and so forth.
1. $ TLC te zq
Now is the time
Now is zhq zimq
*** EOF ***
$
2. $ TLC abc zq
Now is the time for all good men and boys to come to the aid
Now is the time for zll good men znd qoys to qome to the zid
abcaccbaa
zqzqzz Note that multiple occurrences of "a"
aaaaa are replaced by "z" one for one, but
zzzzz multiple occurrences of "b" and "c"
bbbbb are replaced with a single "q", since
q the 'from-char' list is longer than
ccccc the 'to-char' list.
q
*** EOF ***
3. TLC A-Z a-z <mary.caps >mary.lc
This command changes all uppercase
letters in the input file "mary.caps"
to lowercase and writes the results
to the file "mary.lc". Lowercase
characters already in "mary.caps"
remain unchanged.