home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
wp
/
fed134.zip
/
FED.DOC
< prev
next >
Wrap
Text File
|
1993-06-24
|
10KB
|
200 lines
TITLE: FED.EXE Version: 1.34
PURPOSE: Non-interactive text file editor
DATE: June 1993
AUTHOR: Geoffrey H. Gillmer
18 Holmdene Road
7800 Plumstead
SOUTH AFRICA
DESCRIPTION: FED is a non-interactive text file editor. Files are
processed one line at a time so that there is no restriction
on the size of files to be processed. Individual lines can
be up to 32K in size. Edit commands (up to 50) are stored
in a command file. The multiple edit operations are
performed in a single pass.
OPERATION: The command line invocation is:
fed targetfile commandfile ─┘
1. "targetfile" is the text file to be converted and is any
DOS path/file name. Multiple files may be specified by
using the normal DOS wildcards (* and ?). However,
only files with BAT, DOC, INI or TXT extensions as well
as CONFIG.SYS will be processed. Original targetfiles
are saved with a BAK extension provided modifications
have been made.
2. "commandfile" is the unambiguous DOS path/file name
which contains the string edit commands. Edit commands
are described below. Although no restrictions are
placed upon the commandfile name, for sake of clarity it
is suggested that you adopt a consistent naming scheme
for them, say, with a *.FED extension.
EXAMPLES . . .
C> fed testfile.txt testfile.fed ─┘
The above command line will process the input file
"testfile.txt" using the command file "testfile.fed".
The original "testfile.txt" will be retained as
"testfile.bak" provided any modifications were made.
C> fed c:\util\*.bat bat.fed ─┘
The above command line will process all files with a BAT
extension in the "c:\util" subdirectory using the commandfile
"bat.fed". Copies of the original files before conversion
will be retained with BAK extensions.
EDIT FED command files are ASCII text files which contain the
COMMANDS: edit instructions used by the program. Up to 50 of these
commands can be entered in a single file, one command per
line. Blank lines will be ignored.
string1//string2 will replace all occurrences of string1
with string2.
string1||string2 will replace lines containing string1 with
the line string2.
string1&&string2 will append string2 to lines containing
string1. Trailing blanks in the lines
with string1 will be removed before any
modifications are made.
string1^^string2 will prefix string2 to lines containing
string1. The insertion will be made
after any leading blanks.
string1--[string2] will delete lines containing string1 and
will optionally continue deleting lines up
to and including the next line containing
string2. Be careful of this one; if you
specify string2 and a match is found for
string1 but not for string2, then all lines
from string1 will be deleted.
string1!!string2 will strip all of string2 from lines
containing string1.
string1>>string2 will insert the line string2 BELOW lines
containing string1. There is a limitation
of 20 line inserts below the same line
matched by string1.
string1<<string2 will insert the line string2 ABOVE lines
containing string1.
NOTES . . .
The string patterns for matching are not case sensitive.
Blank spaces before string1 or after string2 are not
significant. However, you can use an underscore to prefix
a first blank space to string1 or to append a last blank
space to string2. Any further blanks between the underscore
and string1/string2 will then also become part of the strings.
You can prefix a caret (^) to string1 (and/or string2 for the
delete lines option only) to force the program to look for a
match only at the beginning of the target lines(s). Note
that leading blanks in the target lines are ignored when
testing for matches. Do not therefore include blank spaces
between the caret and the start of the search strings since
these will also be ignored.
Comments can be entered in a command file as lines by
themselves, or set off from a command:
' This is a comment line by itself. Everything
' following a single quote will be treated as a
' comment.
EXAMPLES . . .
temp//tmp ' global change "temp" to "tmp"
^REM// ' remove "REM" from the beginning of
' lines only (leading blanks ignored)
files=||files=40 ' replace lines containing "files="
' with line "files=40"
^files=||files=40 ' replace lines beginning with "files="
' with line "files=40"
path&&c:\util; ' append "c:\util;" to lines
' containing "path"
smartdrv^^REM_ ' prefix "REM " to lines containing
' "smartdrv"
del *-- ' delete lines containing "del *"
del *--^xyz _ ' delete lines containing "del *"
' and continue deleting up to and
' including the next line starting
' with "xyz " (leading blanks ignored)
cache!!/write=off ' strip "/write=off" from lines
' containing "cache"
echo off>>cls ' insert line "cls" below lines
' containing "echo off"
cls<<echo off ' insert line "echo off" above lines
' containing "cls"
SPECIAL NOTE . . .
The order of the edit commands in the commandfile may
influence the results obtained. For example, consider
the two following commands:
smartdrv^^REM_ ' prefix "REM " to lines containing
' "smartdrv"
REM !!REM_ ' strip "REM " from lines containing
' "REM "
These will have no net effect on the line containing
"smartdrv" since the first command will add "REM " while
the following command will cancel this modification.
However, if you swop the order of these commands in the
commandfile, the line containing "smartdrv" will retain
the "REM " addition.
DISCLAIMER: This program is distributed as shareware. Use it, copy
it, upload it, give it to your friends. Please distribute
only the complete program in ZIP form, including the
document file. No warranties, either expressed or implied,
are given by the author or distributor of the program, and
the user accepts all risk of damage arising out of the
application and use of the program.
-----------------------------------------------------------
Send comments/bug reports/contributions to:
╔═══════════════════════╗
║ G.H. Gillmer ║
║ 18 Holmdene Road ║
║ 7800 Plumstead ║
║ SOUTH AFRICA ║
╚═══════════════════════╝
===========================================================================
VERSION HISTORY
---------------
1.32 (June 1993) First public release.
1.33 (June 1993) Append command (&&) changed to insert in front of
trailing blanks.
Prefix command (^^) changed to insert after leading
blanks.
Search strings anchored to the beginning of target
lines now ignore leading blanks in the target lines
when looking for matches.
Documentation expanded.
1.34 (June 1993) The program now attempts to maintain the correct
indentation when inserting new lines.