home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / wp / fed134.zip / FED.DOC < prev    next >
Text File  |  1993-06-24  |  10KB  |  200 lines

  1. TITLE:         FED.EXE      Version: 1.34
  2.  
  3. PURPOSE:       Non-interactive text file editor
  4.  
  5. DATE:          June 1993
  6.  
  7. AUTHOR:        Geoffrey H. Gillmer
  8.                18 Holmdene Road
  9.                7800 Plumstead
  10.                SOUTH AFRICA
  11.  
  12. DESCRIPTION:   FED is a non-interactive text file editor.  Files are 
  13.                processed one line at a time so that there is no restriction
  14.                on the size of files to be processed.  Individual lines can 
  15.                be up to 32K in size.  Edit commands (up to 50) are stored 
  16.                in a command file.  The multiple edit operations are 
  17.                performed in a single pass.
  18.  
  19. OPERATION:     The command line invocation is:
  20.  
  21.                fed targetfile commandfile ─┘
  22.  
  23.                1.   "targetfile" is the text file to be converted and is any 
  24.                     DOS path/file name.  Multiple files may be specified by
  25.                     using the normal DOS wildcards (* and ?).  However,
  26.                     only files with BAT, DOC, INI or TXT extensions as well 
  27.                     as CONFIG.SYS will be processed.  Original targetfiles
  28.                     are saved with a BAK extension provided modifications
  29.                     have been made.
  30.  
  31.                2.   "commandfile" is the unambiguous DOS path/file name 
  32.                     which contains the string edit commands.  Edit commands 
  33.                     are described below.  Although no restrictions are 
  34.                     placed upon the commandfile name, for sake of clarity it 
  35.                     is suggested that you adopt a consistent naming scheme 
  36.                     for them, say, with a *.FED extension. 
  37.  
  38.                EXAMPLES . . .
  39.  
  40.                C> fed testfile.txt testfile.fed ─┘
  41.            
  42.                The above command line will process the input file 
  43.                "testfile.txt" using the command file "testfile.fed". 
  44.                The original "testfile.txt" will be retained as
  45.                "testfile.bak" provided any modifications were made.
  46.  
  47.                C> fed c:\util\*.bat bat.fed ─┘
  48.  
  49.                The above command line will process all files with a BAT
  50.                extension in the "c:\util" subdirectory using the commandfile
  51.                "bat.fed".  Copies of the original files before conversion 
  52.                will be retained with BAK extensions.
  53.  
  54. EDIT           FED command files are ASCII text files which contain the 
  55. COMMANDS:      edit instructions used by the program.  Up to 50 of these
  56.                commands can be entered in a single file, one command per 
  57.                line.  Blank lines will be ignored. 
  58.  
  59.                string1//string2   will replace all occurrences of string1 
  60.                                   with string2.
  61.  
  62.                string1||string2   will replace lines containing string1 with 
  63.                                   the line string2.
  64.  
  65.                string1&&string2   will append string2 to lines containing 
  66.                                   string1.  Trailing blanks in the lines 
  67.                                   with string1 will be removed before any
  68.                                   modifications are made.
  69.  
  70.                string1^^string2   will prefix string2 to lines containing 
  71.                                   string1.  The insertion will be made 
  72.                                   after any leading blanks.
  73.  
  74.                string1--[string2] will delete lines containing string1 and 
  75.                                   will optionally continue deleting lines up 
  76.                                   to and including the next line containing 
  77.                                   string2.  Be careful of this one; if you
  78.                                   specify string2 and a match is found for
  79.                                   string1 but not for string2, then all lines
  80.                                   from string1 will be deleted.
  81.  
  82.                string1!!string2   will strip all of string2 from lines 
  83.                                   containing string1.
  84.  
  85.                string1>>string2   will insert the line string2 BELOW lines 
  86.                                   containing string1.  There is a limitation
  87.                                   of 20 line inserts below the same line 
  88.                                   matched by string1.
  89.  
  90.                string1<<string2   will insert the line string2 ABOVE lines 
  91.                                   containing string1.
  92.            
  93.                NOTES . . . 
  94.  
  95.                The string patterns for matching are not case sensitive.
  96.  
  97.                Blank spaces before string1 or after string2 are not 
  98.                significant.  However, you can use an underscore to prefix 
  99.                a first blank space to string1 or to append a last blank 
  100.                space to string2.  Any further blanks between the underscore 
  101.                and string1/string2 will then also become part of the strings.
  102.  
  103.                You can prefix a caret (^) to string1 (and/or string2 for the 
  104.                delete lines option only) to force the program to look for a 
  105.                match only at the beginning of the target lines(s).  Note
  106.                that leading blanks in the target lines are ignored when 
  107.                testing for matches.  Do not therefore include blank spaces
  108.                between the caret and the start of the search strings since
  109.                these will also be ignored.
  110.  
  111.                Comments can be entered in a command file as lines by 
  112.                themselves, or set off from a command:
  113.  
  114.                '   This is a comment line by itself.  Everything 
  115.                '   following a single quote will be treated as a 
  116.                '   comment.
  117.  
  118.                EXAMPLES . . .
  119.  
  120.                temp//tmp          ' global change "temp" to "tmp"
  121.                ^REM//             ' remove "REM" from the beginning of 
  122.                                   ' lines only (leading blanks ignored)
  123.                files=||files=40   ' replace lines containing "files=" 
  124.                                   ' with line "files=40"
  125.                ^files=||files=40  ' replace lines beginning with "files=" 
  126.                                   ' with line "files=40"
  127.                path&&c:\util;     ' append "c:\util;" to lines
  128.                                   ' containing "path"
  129.                smartdrv^^REM_     ' prefix "REM " to lines containing
  130.                                   ' "smartdrv" 
  131.                del *--            ' delete lines containing "del *"
  132.                del *--^xyz _      ' delete lines containing "del *" 
  133.                                   ' and continue deleting up to and 
  134.                                   ' including the next line starting 
  135.                                   ' with "xyz  " (leading blanks ignored)
  136.                cache!!/write=off  ' strip "/write=off" from lines 
  137.                                   ' containing "cache"
  138.                echo off>>cls      ' insert line "cls" below lines 
  139.                                   ' containing "echo off"
  140.                cls<<echo off      ' insert line "echo off" above lines 
  141.                                   ' containing "cls"
  142.  
  143.                SPECIAL NOTE . . .
  144.  
  145.                The order of the edit commands in the commandfile may
  146.                influence the results obtained.  For example, consider 
  147.                the two following commands:
  148.  
  149.                smartdrv^^REM_     ' prefix "REM " to lines containing
  150.                                   ' "smartdrv"
  151.                REM !!REM_         ' strip "REM " from lines containing
  152.                                   ' "REM "
  153.  
  154.                These will have no net effect on the line containing 
  155.                "smartdrv" since the first command will add "REM " while
  156.                the following command will cancel this modification.
  157.                However, if you swop the order of these commands in the
  158.                commandfile, the line containing "smartdrv" will retain
  159.                the "REM " addition.
  160.  
  161. DISCLAIMER:    This program is distributed as shareware.  Use it, copy 
  162.                it, upload it, give it to your friends.  Please distribute 
  163.                only the complete program in ZIP form, including the 
  164.                document file.  No warranties, either expressed or implied, 
  165.                are given by the author or distributor of the program, and 
  166.                the user accepts all risk of damage arising out of the 
  167.                application and use of the program. 
  168.  
  169.                -----------------------------------------------------------
  170.                Send comments/bug reports/contributions to:
  171.  
  172.                            ╔═══════════════════════╗
  173.                            ║    G.H. Gillmer       ║
  174.                            ║    18 Holmdene Road   ║
  175.                            ║    7800 Plumstead     ║
  176.                            ║    SOUTH AFRICA       ║
  177.                            ╚═══════════════════════╝
  178. ===========================================================================
  179.  
  180. VERSION HISTORY
  181. ---------------
  182.  
  183. 1.32 (June 1993)    First public release.
  184.  
  185.  
  186. 1.33 (June 1993)    Append command (&&) changed to insert in front of 
  187.                     trailing blanks.
  188.  
  189.                     Prefix command (^^) changed to insert after leading 
  190.                     blanks.
  191.  
  192.                     Search strings anchored to the beginning of target 
  193.                     lines now ignore leading blanks in the target lines 
  194.                     when looking for matches.
  195.  
  196.                     Documentation expanded.
  197.  
  198. 1.34 (June 1993)    The program now attempts to maintain the correct 
  199.                     indentation when inserting new lines.
  200.