# Text Filter Utility

Topics

:

Overview
Usage

Overview

The Text Filter utility is a console-based program used to filter any unwanted characters from text files. This program can also be used to convert text files from a DOS format to a UNIX format or from a UNIX format to a DOS format.

Usage

To use the utility, enter the name of the program followed by the name of the text file. NOTE: If you do not specify an output file name, the program will write to the console.

    txfilter  myfile.txt (Write to console)

    txfilter myfile.txt newfile.txt (Write to myfile.txt file)

    txfilter myfile.txt > newfile.txt (Redirect to file)

    txfilter myfile.txt >> newfile.txt (Append to file)

You can pass one of several switches to the program from the command line. For a list of switches, execute the program with no arguments or with a "-?" argument: "txfilter" or "txfilter -?"

    ASCII Text file filter program version 4000.101
    Usage: txfilter [switches] infile.txt
    Switches:  -?      = Display this help message.
               -A      = Output alphabetic characters only.
               -d      = Output text file in DOS CR/LF format.
               -D      = Do not insert line feeds.
               -M      = Output alphanumeric characters only.
               -n      = No text filtering (defaults to filtered).
               -N      = Output numeric characters only.
               -o      = Write output to the existing file (defaults to stdout).
               -P      = Output printable characters only (default).
               -t      = Filter tabs.
               -s      = Filter spaces.
               -u      = Output text file in UNIX format (default).

The "-A" switch is used to output alphabetic characters only. All numbers and non-alphanumeric characters will be removed.

The "-d" switch is used to output the text file in a DOS text file format. In DOS and Windows there are two file types: a text file and a binary file. A DOS text file uses a CR/LF (Carriage-Return/Line-Feed) sequence to represent the end of a line in a text file and a Control-Z character to represent the end of a text file. In UNIX a single LF represents the end of a line and the end of a text file. If the "-d" option is not specified a UNIX format will be used by default.

The "-D" switch will not insert any line feeds in the output stream.

The "-M" switch is used to output alphanumeric characters only. All non-alphanumeric characters will be removed.

The "-n" switch is used to turn the filtering off so that the file can be viewed in its original state before it is filtered.

The "-N" switch is used to output numeric characters only. All alphabetic and non-alphanumeric characters will be removed.

The "-o" switch is used to overwrite the existing file.

The "-P" switch is used to output all the printable characters in the text file. All control characters will be stripped from the text file and all carriage returns and line feeds will be inserted in their proper place.

The "-t" switch is used to filter tabs from a text file.

The "-s" switch is used to filter spaces from a text file.

The "-u" switch is used to output the file in a UNIX text file format.

End Of Document