Replace Filter in FormTrap Server
Note: This software is supplied with three months warranty, with no ongoing support or charges. It is designed for single-byte encoding systems only.
Introduction
This filter is used to modify FormTrap input or output. Data to
change is recognized by a character string, with optional
replacement of that character string.
To delete characters, use "" as the empty replace string.
This filter is the "go to" solution for ongoing issues with data
emitted from old and immovable systems and once "plugged in" removes
those issues for ever. It is also useful to invoke laser printer
special handling options, such as stapling.
Components
There are two components to the filter:
- replace.exe - the executable program
- replace.ini - stores character sequences to be identified and replaced and must be in the same directory as the program.
Both are normally in the same ..\fthome\v7\programs folder.
Format of replace.ini
replace.ini is built in sections. Sections are set up in the following format:
[section]
"old_string" "new_string" all/first
Where
- section is a name to identify this operation;
- "old string" is the string to be replaced;
- "new string" is the replacement; and
- all/first defines whether the replacement should occur on only the first instance or all instances of the string in the file.
For example, a section to select output bin 2 ("normal" for HP 9040) with the optional HP Q5693A 8-bin mailbox is shown below:
[OutputBin2Normal]
"@PJL COMMENT" "@PJL SET OUTBIN=OPTIONALOUTBIN2\0D\0A@PJL SET
FINISH=NONE\0D\0A@PJL COMMENT" First (all on one line)
Special Characters: Unprintable characters (eg. escape, form feed) are represented by using a backslash "\" character followed by the ASCII representation of the character in hexidecimal format. For example, the escape character is represented as "\1b" - any case for characters a-f (A-F).
Multiple "old string" "new string" "all/first" lines may be provided and are inspected in the order given. Already processed replacement strings are NOT re-inspected.
Usage - Command Line
Command line is the norm for Unix/Linux and may be used for Windows outside of the normal Server procedure. You can use "replace" on any file, outside of FormTrap. The filter takes three parameters:
input file (replace with hyphen for stdin)
output file (replace with hyphen for stdout)
section name
Examples (second example assumes stdin and stdout files):
replace "c:\files\input.pcl" "c:\formtrap\output.pcl" short
replace - - short
Installation within Server V7 or V8 via Setup
This is the norm for the replace filter, where each Section is a different filter within Setup. Filters are normally invoked as External input (and MUST precede the "Western" filter) or invoked as Post formatting filter for output manipulation (normally to drive special features of laser printers).
Version 7 or Version 8 Installation, SBE and Enterprise:
- Copy replace.exe and replace.ini to the %ftinst% folder.
- Define each different required Section in Setup, Filters (see the manual page via F1 and below) and invoke via Queues, Filters tab.
- This is the Setup Filters screen for the
filter to output to Bin 2, Normal for the HP 9040 with HP Q5693A
8-bin mailbox attached.
Note that input and output use the hyphen to indicate stdin and stdout.