home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / EX2.ZIP / EX2.DOC next >
Text File  |  1989-12-18  |  4KB  |  111 lines

  1. EX2 - Binary File Replace Utility for OS/2
  2. ==========================================
  3.  
  4.  
  5. General:
  6.  
  7. EX2 is an easy to use binary file replace utility. The program is
  8. written in pure assembler, a fact which guarantees a very small
  9. program size and the fastest execution possible.
  10. EX2 is intended to be used with binary files (you can use it of course
  11. with text files too) of any size (up to the limit imposed by the
  12. operating system).
  13.  
  14. EX2 is the successor to EX, which is a program doing the same as EX2
  15. under MS/DOS.
  16.  
  17. EX2 uses the standard streams STDIN and STDOUT for input and output.
  18. STDIN and STDOUT are normally assigned to the console (keyboard and
  19. screen). They can be redirected and this EX2 expects.
  20.  
  21.  
  22. Usage:
  23.  
  24.     EX2 <inputfilename >outputfilename search-string replace-string
  25.  
  26.  
  27. Where:
  28.  
  29. inputfilename:   name of an existing file
  30. outputfilename:  name of the file where the modified content of the
  31.                  input file will be written to. If the file already
  32.                  exists the old content will be discarded. If the file
  33.                  doesn't exist it will be created.
  34.  
  35.                  Important!!!
  36.                  Never use the same name for input and output
  37.                  file. This would lead to a destruction of the
  38.                  content of the file.
  39.  
  40. search-string:
  41. replace-string:  The search- and replace-strings must be continous
  42.                  sequences of characters, which are permitted to occur
  43.                  on a command line as normal characters. For example:
  44.                  following characters are not allowed as parts of the
  45.                  search- and replace-strings:
  46.                  (SPACE),(TAB),?,*,;,<,>,etc. 
  47.                  Please consult your OS/2 user manual for a detailed
  48.                  description.
  49.                  This notation doesn't restrict you to normal
  50.                  characters. (This wouldn't be the right way for a
  51.                  'binary' replace utility).
  52.                  Whenever you want to define a character not permitted
  53.                  to occur on a command line or if you know only the
  54.                  HEX-value of the character you can use the following
  55.                  representation: #Hex-value (2 digits)
  56.                  For example: #0A (or #0a) is the valid representation
  57.                  of LINE-FEED.
  58.  
  59.  
  60. At process termination EX2 will return one of the following return codes:
  61.  
  62. Exit-Code              Indication
  63.    0                   Everything worked fine, no error
  64.    1                   Error: No search string found
  65.    2                   Error: Couldn∩t allocate memory
  66.    3                   Error: Couldn∩t read from STDIN
  67.    4                   Error: Couldn∩t write to STDOUT
  68.    5                   Error: Invalid token in search or replace string
  69.  
  70.  
  71.  
  72. How to use:
  73.  
  74. 1. Example:
  75.  
  76. You have a lot of text files and you want to replace every occurrence
  77. of CR+LF with LF and every occurrence of a TAB with 4 SPACES.
  78.  
  79. You can proceed in two ways:
  80. - You call the program EX2 two times per file.
  81. - You write a batch-job which calls EX2 two times per file:
  82.  
  83.      Batch File:
  84.  
  85.        EX2 <%1 >temp #0D#0A #0A
  86.        EX2 <temp >%2 #09 #20#20#20#20
  87.        del temp
  88.  
  89.        To call this batch file you must type:
  90.  
  91.            'batchfilename' 'inputfilename' 'outputfilename'
  92.  
  93. - You call EX2 two times at once by using the piping feature
  94.  
  95.        EX2 <∩input∩ #0D#0A #0A | EX2 >∩output∩ #09 #20#20#20#20
  96.  
  97. 2. Example:
  98.  
  99. You have a file and you want to replace every occurrence of the string
  100. 'Main Menu' with the string 'MAIN MENU':
  101.  
  102. EX2 <'inputfilename' >'outputfilename' Main#20Menu MAIN#20MENU
  103.  
  104.  
  105.  
  106.  
  107. Please report any problems or suggestions to:
  108.  
  109. The author
  110. Franz Krainer    FidoNet 2:310/11.17
  111.