
           ExeFilt - External filter plugin for FAR editor
           -----------------------------------------------

                    Version 1.1, 03 Oct 2001.


This plugin runs any given program from the FAR editor, feeds the selected
text to the program's standard input (stdin), waits for this program to
terminate and puts its standard output (stdout) back to the file. In
other words, the plugin runs an *external filter* on the selected text.

These filters are any Win32 console or DOS programs you can redirect
input to and output from using characters '>' and '<' in the command line,
or let any program's output through using the pipe character ('|').

Examples of such filters are: some standard DOS/WinNT commands (sort, find),
some utilities ported from UNIX (awk, sed, cut,...) etc.

You can specify any command-line options for your filter. You don't have
to put the <>| characters in command line for redirection purpose,
since the text is redirected automatically. Moreover, if your command line
contains characters like "<" or "|", you don't have to "shield" them
(to put them in quotes). However, don't forget to "shield" expressions with
space characters.

The plugin's behaviour depends on text selection and the checkbox "Feed all
text to the filter".

    Situation           Filter's input         Filter's output
-----------------------------------------------------------------------
A block is selected     Selected text      Replaces the selected text.
                                            All selection is deleted.
-----------------------------------------------------------------------
No block is selected;   The whole text    Inserted at cursor position
[x] "Feed all text"
-----------------------------------------------------------------------
No block is selected;    Nothing          Inserted at cursor position
[ ] "Feed all text"


Usage examples (assume all the text is selected):

sort /+5
Sort the lines according to characters beginning from 5th column.

sed "s/for *( */for( /g"
Do a global replace using the regular expressions.

awk /Michael/||/Mike/
Delete all lines except for those containing "Michael" or "Mike".
Remember you can use any regular expressions here!

(Assume no text is selected.)
awk "/#define/{n++} END {print n}"
Count lines with the string "#define" and insert the resulting number
at the cursor position.

(Assume a column is selected.)
awk {printf(\"%02d\",n);n++}
Replace the selected column with line numbers.

You call freely use any AWK statements and script files and other script
languages such as Perl or JScript.

For more details, refer to the utilities' manuals. Discover the world of
UNIX filters! :)


Michael Yutsis
michael.y@bigfoot.com
http://fidonet.org.il/YMS/
