home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / SNR301.ZIP / SNR.DOC < prev    next >
Text File  |  1989-11-03  |  14KB  |  288 lines

  1. TITLE:         SNR.EXE             VERSION: 3.01
  2.  
  3. PURPOSE:       Multiple simultaneous Search 'N' Replace program
  4.  
  5. DATE:          11/3/89
  6.  
  7. AUTHOR:        Thomas A. Lundin
  8.                9129 Colfax Avenue South
  9.                Bloomington, MN 55420
  10.                Day phone: (612) 588-7571
  11.  
  12. DONATION:      $10 requested
  13.  
  14. DESCRIPTION:   SNR is a multi-string search-and-replace filter. Both 
  15.                text and binary files can be processed by the program, 
  16.                since SNR allows the definition of hex values in a 
  17.                search-and-replace equation. Up to 50 equations can be 
  18.                entered into an SNR table, each of which can be a maximum 
  19.                of 200 characters in length. The multiple 
  20.                search-and-replace operations are performed in a single 
  21.                pass.
  22.  
  23. REVISION       3.01 - 11/3/89
  24. HISTORY:       Program recompiled for family mode, meaning it will run 
  25.                as-is under DOS, OS/2 real mode, and OS/2 protected mode.
  26.  
  27.                Also improved I/O throughput on fast disk drives.
  28.  
  29.                3.0 - 9/27/89
  30.                The program has been completely rewritten. The pesky bugs
  31.                that were present in versions 1.5 and 2.0 have been 
  32.                eliminated.
  33.  
  34.                All binary characters INCLUDING NULLS can now be searched 
  35.                and replaced. Nulls can also be entered as part of a 
  36.                larger search-and-replace equation.
  37.  
  38.                The equation length has been increased to 200 characters, 
  39.                which can be split into search and replace sides of any 
  40.                length, as long as the total does not exceed 200.
  41.  
  42.                Equations no longer need to be in any specific order.
  43.  
  44.                The average speed of the program has been vastly 
  45.                improved, especially for multiple and high-occurrence 
  46.                search and replaces.
  47.  
  48.                An automatic "bit-stripping" feature has been added which
  49.                removes the high-order bits from input characters, 
  50.                forcing 8-bit codes into 7-bit ASCII. THIS IS NOW THE 
  51.                DEFAULT ACTION, but this feature can be disabled for 
  52.                binary files.
  53.  
  54.                The program no longer needs to read itself for runtime 
  55.                parameters.
  56.  
  57. OPERATION:     The command line invocation is:
  58.  
  59.                snr [@]filename ext tablename [/d] ─┘
  60.  
  61.                1.   "filename" is any unambiguous DOS path/file name. An 
  62.                     optional at-sign (@) in front of the filename indicates 
  63.                     that multiple files are to be processed from a directory 
  64.                     list file, i.e., a file that has been created from a 
  65.                     redirected DIR command. For example, the DOS command 
  66.  
  67.                     dir *.txt >dirfile  ─┘
  68.  
  69.                     will create a disk file named "dirfile" which contains a 
  70.                     directory of all files with a ".TXT" extension.
  71.  
  72.                2.   "ext" is the filename extension you wish to assign each 
  73.                     output file. The output files are created using the name 
  74.                     of the input file plus the extension specified here. The 
  75.                     choice of an extension is important; if you accidentally 
  76.                     choose an extension which is already used by an input 
  77.                     file, the result of the process is indeterminable, 
  78.                     although file data loss is likely to occur. Use an 
  79.                     extension which is sure to be unique.
  80.  
  81.                     Extensions can be the DOS device names CON, NUL, 
  82.                     AUX, and PRN. In any of these four cases, an output 
  83.                     file is NOT created on disk; rather, the output is 
  84.                     redirected to the console (CON), nowhere (NUL), the 
  85.                     rs232 port (AUX), or the printer (PRN). Using CON is 
  86.                     handy for a quick preview of the conversion process 
  87.                     before storing it to disk.
  88.  
  89.                     NOTE: If you preview converted binary files to CON, 
  90.                     be aware that hex code 1A (DOS end-of-file) will 
  91.                     terminate the conversion display, perhaps 
  92.                     prematurely. This permature termination will NOT 
  93.                     occur when you store to disk.
  94.  
  95.                3.   "tablename" is the unambiguous DOS path/file name which 
  96.                     contains the string translation "equations". Although no 
  97.                     restrictions are placed upon the tablename, for sake of 
  98.                     clarity it is suggested that you adopt a consistent naming 
  99.                     scheme for them, (say, with an *.SNR extension). Tables 
  100.                     are discussed in more detail below. 
  101.  
  102.                4.   "/d" is an option which replaces the original input file 
  103.                     with the converted data. The EXT specified on the 
  104.                     command line is thus used temporarily until the conversion 
  105.                     is complete, at which time the program performs an 
  106.                     internal file delete/rename operation. 
  107.  
  108.                EXAMPLES...
  109.  
  110.                C>snr tstfil.doc txt tst.snr ─┘
  111.  
  112.                The above command line will process the input file 
  113.                "tstfil.doc" and create an output file "tstfil.txt" using 
  114.                the table "tst.snr". 
  115.  
  116.                C>snr @dirlist p1 sample.snr ─┘
  117.  
  118.                The above command line will process a group of files 
  119.                contained in the directory list "dirlist" and create a 
  120.                group of output files with extensions of *.p1 using the 
  121.                table "sample.snr".
  122.  
  123. CONVERSION     SNR tables are ASCII text files which contain the 
  124. TABLES:        search-and-replace equations used by the program. Up to 
  125.                50 of these equations can be entered in a single table; 
  126.                each equation can consist of 200 characters split freely 
  127.                between the search side and the replacement side. Blank 
  128.                lines will be ignored by the table processor. A sample 
  129.                equation would be: 
  130.  
  131.                Now is the time=NOW IS THE TIME
  132.  
  133.                It should be obvious that this equation will translate an 
  134.                upper-and-lower case version of the words "now is the time" to 
  135.                an all-upper-case string. Notice that spaces ARE SIGNIFICANT 
  136.                characters in an equation. A search string can be defined to 
  137.                output nothing, simply by leaving out a replacement string:
  138.  
  139.                Now is the time=
  140.  
  141.                If spaces are desired at the end of a replacement string, 
  142.                and you want to be sure they are there, they can be 
  143.                defined as hex codes:
  144.  
  145.                Now is the time =NOW IS THE TIME\20
  146.  
  147.                Any hex code can be formed from a backslash followed by two hex 
  148.                digits (0-9, a-f, A-F). For instance, a carriage return/line 
  149.                feed sequence (CRLF) can be specified like this: 
  150.  
  151.                \0d\0a\0d\0a=\0d\0a
  152.  
  153.                The above equation will convert two CRLFs in a row to a 
  154.                single CRLF. A consequence of using the backslash 
  155.                notation for hex codes is that the backslash character 
  156.                itself must be specified in a string as \5c. Likewise, 
  157.                the equals sign must be specified in a string as \3d. 
  158.  
  159.                The end of a table is signified by a \\E on a line by itself. 
  160.                This code is optional, but recommended, since it will prevent 
  161.                the table processor from inadvertently reading past the end of 
  162.                your equations (some word processors may pad their last blocks 
  163.                with garbage, which the table processor would attempt to read 
  164.                as equation data). 
  165.  
  166.                Comments can be entered in a table as lines by themselves, or 
  167.                set off from an equation:
  168.  
  169.                \    This is a comment line by itself.
  170.                \    A comment consists of a single backslash
  171.                \    followed by one or more spaces.
  172.  
  173.                \0d\0a=\0d\0a  \ this will ensure that existing CRLF pairs are
  174.                               \ left untouched
  175.                \0d=\0d\0a     \ this equation will convert an isolated CR 
  176.                               \ into a CRLF
  177.                \0a=\0d\0a     \ this equation will convert an isolated LF
  178.                               \ into a CRLF
  179.  
  180.                \\E
  181.  
  182.                Equation ordering is immaterial. SNR will automatically 
  183.                sort equations by length when assembling a table in 
  184.                memory.
  185.  
  186.                BIT-STRIPPING...
  187.                SNR's default action is to map all incoming characters to 
  188.                7-bit ASCII before running them through the equations. 
  189.                This is handy if you're converting an old Wordstar file, 
  190.                and don't want to deal individually with the tagged 
  191.                characters.
  192.  
  193.                This action, however, is not at all welcome when you're 
  194.                dealing with files that make use of specific binary 
  195.                characters (examples: Word Perfect, XYWrite, others). In 
  196.                cases where you DON'T want 7-bit mapping to occur, type a 
  197.                \\L8 as the first line of a table; this will disable 
  198.                bit-stripping for that table.
  199.  
  200.                An interesting side-effect of the bit-stripping feature 
  201.                is illustrated by the table STRIP.SNR. It contains NO 
  202.                equations at all (except for the \\E), and yet it will 
  203.                effectively remove the high-order bits from any file that 
  204.                it is run through. Try it!
  205.  
  206. NOTES:         The program will run on any IBM PC/XT/AT series computer 
  207.                using MS-DOS 2.x or higher, with a minimum of 128K RAM.
  208.  
  209.                SNR was compiled with Lattice C 6.01.
  210.  
  211. DISCLAIMER:    This program is distributed as shareware. Use it, copy 
  212.                it, upload it, give it to your friends. Please distribute 
  213.                only the complete program in ZIP form, including all 
  214.                document and sample files. No warranties, either 
  215.                expressed or implied, are given by the author or 
  216.                distributor of the program, and the user accepts all risk 
  217.                of damage arising out of the application and use of the 
  218.                program. 
  219.  
  220. CONTRIBUTION:  If you like the program, contributions in any amount ($10 
  221.                requested) will be gratefully accepted. I would hope that 
  222.                you get at least that much value out of it. Please make 
  223.                checks payable to Thomas A. Lundin and mail to the address 
  224.                shown at the top of this DOC file.
  225.  
  226. COMMERCIAL:    SNR contains a small subset of the capabilities of 
  227.                SuperConverter, a program that is available as a
  228.                commercial purchase through the company I work for, whose 
  229.                phone number I've listed below. If you like SNR, you'll 
  230.                love SuperConverter.
  231.  
  232.                For $149, SuperConverter allows up to 2,500 
  233.                search-and-replace equations per table, and each equation 
  234.                can consist of up to 4,999 characters. SuperConverter's 
  235.                other features include:
  236.  
  237.                WILD CARD MATCHING: search and replace on general 
  238.                patterns of characters such as numbers, alphabetic 
  239.                characters, control characters, printable characters, 
  240.                punctuation, etc. -- eleven wild card types in all.
  241.  
  242.                FLAGGING: 16 toggle flags allow you to search 
  243.                identical input equations and replace them with 
  244.                different outputs, depending on whether a flag is on or 
  245.                off. For example, you can make a double-quote character 
  246.                be replaced alternately with left and right single 
  247.                quotes.
  248.  
  249.                VARIABLE-LENGTH SEARCH-AND-REPLACE: convert a string of 
  250.                unknown length and treat it as a block of data. Then you 
  251.                can add codes to either side of the block, or re-arrange 
  252.                several blocks (such as tab-delimited fields), or remove 
  253.                the blocks from output.
  254.  
  255.                ...AND MORE!
  256.  
  257.                SuperConverter has been used to process files for 
  258.                typesetting and disk conversion at my work since 1982. 
  259.                Commercial purchasers will receive a printed manual and 
  260.                over 30 useful sample tables.
  261.  
  262.                SuperConverter comes with a 30-day money-back guarantee.
  263.  
  264.                For more information, call me at work at the number 
  265.                listed below (8am-5pm Central Time, Mon-Fri).
  266.                (Prices subject to change.)
  267.  
  268.                -----------------------------------------------------------
  269.                Send comments/bug reports/contributions to:
  270.  
  271.                          ╔══════════════════════════╗
  272.                          ║     Thomas A. Lundin     ║
  273.                          ║ 9129 Colfax Avenue South ║
  274.                          ║  Bloomington, MN  55420  ║
  275.                          ║ Daytime # (612) 588-7571 ║
  276.                          ╚══════════════════════════╝
  277.  
  278.                You can also reach me at my BBS home base:
  279.  
  280.                                 PC-ROCKLAND BBS
  281.                       If you can't find a program here,
  282.                           it probably doesn't exist!
  283.                                 (914) 353-8153
  284.                         (Leave msg. for "Tom Lundin")
  285.  
  286.                Thank you for using SNR.
  287.  
  288.