home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / repltext.zip / repltext.doc < prev    next >
Text File  |  1999-05-11  |  4KB  |  119 lines

  1. ReplText/2 v1.03 Freeware (c) 1999 by Robert Schroeder
  2. Simple string replacing utility for text files
  3.  
  4. D e s c r i p t i o n 
  5.  
  6.   ReplText simply replaces all occurrences of one string pattern within a file 
  7.   with another string pattern. It ain't grep!
  8.  
  9. I n s t a l l a t i o n
  10.  
  11.   Put repltext.exe in a directory that shows up in the OS/2 path statement. Put
  12.   kbdvio32.dll in the same (or in a directory that is within the OS/2 libpath).
  13.  
  14. U s a g e 
  15.  
  16.   At the OS/2 command line, type:
  17.  
  18.   repltext <textfile> [<pattern1> <pattern2>|/f:<patternfile>] [/c]
  19.  
  20. P a r a m e t e r s 
  21.  
  22.   <textfile>       the name of the text file where patterns are to be replaced
  23.   <pattern1>       the string to be searched for (optionally enclosed in double 
  24.                    quotes)
  25.   <pattern2>       the string pattern1 is to be replaced with (optionally 
  26.                    enclosed in double quotes). 
  27.   /c               do distinguish between upper and lower case characters
  28.   /f:<patternfile> read patterns from file instead of getting them from the 
  29.                    command line
  30.  
  31. R u l e s   f o r   c o m m a n d - l i n e   p a t t e r n s
  32.  
  33.   Patterns may be enclosed in doube quotes. Patterns must be enclosed in double
  34.   quotes when they contain special characters which otherwise would be 
  35.   interpreted by the OS/2 command line interpreter. Such characters include 
  36.   the ampersand '&', the blank character ' ' and also the double quote '"' 
  37.   itself: double quotes can be used when enclosed in more double quotes ("this 
  38.   is a pattern containing "double quotes"").
  39.  
  40.   Due to a restriction of the applied compiler, when specified as command line 
  41.   parameters, string patterns MAY NOT CONTAIN angular brackets ('<' or '>' 
  42.   characters), even when enclosed in double quotes, which of course is somewhat 
  43.   annoying when replacing text in HTML files - that's the main reason why there 
  44.   is the option to use a pattern file.
  45.  
  46. P a t t e r n   f i l e 
  47.  
  48.   A pattern file is supposed to contain just the search pattern and the replace 
  49.   pattern in two consecutive lines, one line each, no enclosing quotes. All
  50.   printable characters are allowed. A pattern may not exceed 255 characters of
  51.   length.
  52.  
  53. E x a m p l e s 
  54.  
  55.   repltext textfile.txt right left
  56.   repltext somefile "one plus two" "1 + 2"
  57.   repltext anotherfile.txt /f:pattern.fil /c
  58.   repltext index.html "color="#ff0000"" "color="#00ff00""
  59.  
  60.   To replace all 'bold' tag pairs in an HTML file with 'italics' tag pairs, call
  61.     repltext file.html /f:btoi1.pat
  62.     repltext file.html /f:btoi2.pat
  63.   with btoi1.pat consisting of the two lines:
  64.     <B>
  65.     <I>
  66.   and btoi2.pat consisting of the two lines:
  67.     </B>
  68.     </I>
  69.  
  70. H i s t o r y
  71.  
  72.   v1.0  (06-Feb-99) - First public release (erroneously showed v0.2 04-Feb-99)
  73.   v1.01 (10-Feb-99) - Repackaged with the previously missing kbdvio32.dll
  74.   v1.02 (10-May-99) - Bug fixed, new bug introduced :-(
  75.   v1.03 (11-May-99) - New bug fixed
  76.  
  77. F u t u r e   p l a n s 
  78.  
  79.   all of which are classified 'well, maybe...', listed in my personal order of 
  80.   preference:
  81.  
  82.   Allow file specifications containing wildcards for searching and replacing 
  83.   through a number of files in one pass.
  84.  
  85.   Make it work recursively through subdirectories as well, optionally.
  86.  
  87.   (Until then, both can easily and well be accomplished by using Kai Uwe 
  88.   Rommel's 'forall'.)
  89.  
  90.   Enable multiple search and replace patterns for one pass (which can easily 
  91.   be accomplished by extending the pattern file).
  92.  
  93.   If someone wants it, I'll make a gooey, erm, GUI version with the current
  94.   functionality and performance (which should be quite good for lines shorter 
  95.   than 256 chars, but slows down significantly when there's a considerable
  96.   amount of longer lines. Though I must admit I haven't done any comparative 
  97.   benchmarking yet). The task would be easy, so tell me if you want it.
  98.  
  99. C o n t a c t
  100.  
  101.   The latest version of ReplText/2, more information of anything I might do for
  102.   OS/2 in the future (I'm working on a simple directory replication scheduler)
  103.   is to be found at <http://rob.schroeder.net/os2>.
  104.  
  105.   I can be contacted by e-mail <rob@schroeder.net>.
  106.  
  107. D i s c l a i m e r
  108.  
  109.   I don't guarantee anything, I won't be hold responsible for anything either,
  110.   and the copyright for this program is mine and only mine.
  111.  
  112. ---
  113.  
  114. Have fun!
  115.  
  116. Robert Schroeder 
  117. rob@schroeder.net
  118. http://rob.schroeder.net
  119.