Filter (software)

From Wikipedia, the free encyclopedia

A filter is a computer program to process a data stream. Some operating systems such as Unix are rich with filter programs. Even Windows has some simple filters built in to its command shell, most of which have significant enhancements relative to the similar filter commands that were available in MS-DOS.

Just as in Unix, such a filter usually gets most of its data from standard input (the main input stream) and writes its main results to standard output (the main output stream). The command syntax for getting data from a device or file other than standard input is the input operator ("<"). Similarly, to send data to a device or file other than standard output is the output operator (">"). To append data lines to an existing output file, one can use the append operator (">>").

The similarity with Unix extends to filters used as elements of pipelines. The pipe operator ("|") on a command line signifies that the main output of the command to the left is passed as main input to the command on the right. From the early days of DOS based computers, the two classic filters are find and sort.

Examples:

  • find "keyword" < inputfilename > outputfilename
  • sort "keyword" < inputfilename > outputfilename
  • find /v "keyword" < inputfilename | sort > outputfilename

Such filters may be used in batch files (*.bat, *.cmd etc.).

For use in the same command shell environment, there are many more filters available than those built in to Windows. Some of these are freeware, some shareware and some are commercial programs. A number of these mimic the function and features of the filters in Unix. Some filtering programs have a graphical user interface (GUI) to enable users to design a customized filter to suit their special data processing and/or data mining requirements.

[edit] See also

In other languages