home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 121 / af121sub.adf / Change.lzx / Change / Change.doc < prev    next >
Text File  |  1979-05-29  |  9KB  |  218 lines

  1. This program gives you the ability to search for different strings in files
  2. and to replace them with other string. The file could be binary or ascii.
  3. An example is if you change your harddisk and then most of the old path
  4. names also change. Normally you have to do this file for file by hand. With
  5. change it's much more easier! Only use change in a script with all (or all
  6. needed) files and the replacement is done.
  7.  
  8. Change is programmed with MaxonC++ and later SAS-C (but mostly in C and
  9. not C++) and it's Public Domain. I give all rights of the program to the
  10. user, but the same way I give no guarantee that the program works well.
  11. Use it of your own risk!
  12.  
  13. Since version 2.0 Change has a GUI. The elements of the GUI are the same
  14. like the Shell arguments! You can start Change with GUI from WB or from
  15. Shell without arguments. If you give arguments in the shell, Change will
  16. work with this arguments without opening a window!
  17.  
  18. The program requires OS2.0 (V37) or any later version.
  19.  
  20. The history of the program is in the source code -> source/Change/Change.c
  21.  
  22. If you call Change with ?(»Change ?«) you get the following argument list:
  23.  
  24. FROM/A,SSTRING/A,TO,RSTRING,FOUND/S,HEX/S,LENGTH/S,NOCHANGE/S,NOSIZE/S,
  25. OVERWRITE/S,PATH/S,POS=POSITION/K:
  26.  
  27. Enter again a ? and you will get a better explanation.
  28.  
  29. With »Version Change FULL« you get the actual version of this program.
  30. Thats useful for updating.
  31.  
  32. Explanation of arguments:
  33. FROM        the already existing file Change should work with
  34.         Starting with 2.33 Change allows use of patterns in file
  35.         names. See below for comments.
  36.         > needed every time !
  37. SSTRING        is the string Change should search for
  38.                 > needed every time !
  39. TO        the file Change should write to
  40.         if it's the same like FROM (or their is no TO) it will be
  41.         overwritten! (only if there is enough memory to load it,
  42.         else the name will get _ at the end)
  43.                 > needed every time (not with option NOCHANGE)
  44. RSTRING        is the replacement for SSTRING
  45.                 > not needed, if not given an empty string is used
  46. FOUND           gives you  every tim SSTRING is found or changed a output
  47.         (for example: String found at 32C). The number is the hexa-
  48.         decimal code of the position.
  49.                 > not needed, of no use with NOCHANGE
  50. HEX             gives you the posibility to enter the strings as hex
  51.         numbers. (Some chars can't be entered with the keyboard -
  52.         RETURN - 0A for example)
  53.                 > not needed
  54. LENGTH          changes the length information of a BCPL string (first
  55.         character contains length of string)
  56.                 > not needed, of no use with NOCHANGE and same length of
  57.                 of the strings, idiotic with a normal C-string (with 0 at
  58.                 end)
  59. NOCHANGE        turn of the replacement, only search SSTRING like Search
  60.         command in C:, Option FOUND automatical turned on
  61.         > not needed, Options TO, LENGTH, OVERWRITE, PATH, RSTRING
  62.         not useable
  63. NOSIZE          scan case insensitiv
  64.                 > not needed
  65. OVERWRITE       If RSTRING is longer than SSTRING the chars after RSSTRING
  66.         will be replaced, if RSTRING is shorter, the rest will be
  67.         filled with 0. This option is useful if you change strings
  68.         in executable filles, because the length can't be changed
  69.         May produce too long files, when RSTRING is larger than
  70.         SSTRING and replacement is near the fileend.
  71.                 > not needed, of no use with same length of the strings
  72.                 > turned off, when PATH is active
  73. PATH            Option to replace path names. It's like overwrite, but the
  74.         filling or overwriting starts first, when a 0 is found after
  75.         the replacement!
  76.         May produce too long files, when RSTRING is larger than
  77.         SSTRING and replacement is near the fileend.
  78.                 > turns off OVERWRITE, useless with same length of strings
  79. ALL        deep scanning in directories
  80.         > not needed
  81. POS             see POSITION
  82. POSITION        After POSITION you have to give a hex number of the position
  83.         you want to change sstring. If there is no sstring at this
  84.         position no replacement would be done. A position you can
  85.         get before that with the option NOCHANGE
  86.                 > not needed, of no use with NOCHANGE
  87.  
  88.  
  89. If you give no keywords, the first string is FROM, the second SSTRING, the
  90. third TO and the fourth RSTRING.
  91.  
  92. File-Patterns: Change supports the usage of file patterns. When multiple
  93. input files are found, the destination must be a directory. So there can
  94. be different cases:
  95. 1) Only one source and destination file
  96.    - Change works from source to destination
  97. 2) One source file and destination directory
  98.    - Change stores the destination file with source name in destination
  99.      directory.
  100. 3) Multiple source and destination directory
  101.    - Change stores the files (with ALL paramter also files from sub
  102.      directories) in destination with their source name.
  103. 4) Multiple source files and one destination name
  104.    - Change processes first file and brings an error for next one.
  105. 5) No destination given
  106.    - Change replaces the file(s).
  107.  
  108. With parameters NOCHANGE and POSITION, Change may find more positions than
  109. can be replaced by a normal pass. This is because these options display
  110. overlapping areas as well. In Change pass this is not possible.
  111.  
  112. Change also works with a pattern. If there is a \? in the text (or a ? in
  113. HEX mode) at this position every char will be accepted!
  114. Important:
  115.     \? is the pattern
  116.     \\ means one \
  117.     \  and after this a hex number with 2 digits means the char given
  118.     through the ascii-code(f.i. \57 is a W)
  119.         
  120. (see the examples)
  121. If you enter strings with HEX option all chars of no use are ignored. Only
  122. (0..9 a..f A..F ?) will be recognized. This means you can enter slashes
  123. between the chars to make it better visible.
  124. 123a4b52349f009a is the same as 123a_4b52_349f_009a or 123a.4b52.349f.009a
  125. or 1-2-3-a-4-b-5-2-3-4-9-f-0-0-9-a.
  126.  
  127. At the program start Change tells you the two strings it works with.
  128. Chars from 20 to 7E and from A1 to FF will be shown like given. 
  129. . means a non printable char and
  130. _ means a pattern.
  131.  
  132. At the end the program gives you a status report of the done work:
  133. String ... times found and ... times changed
  134.  
  135. Examples:
  136. You want to search in the file SYS:Texts/S the name Intel:
  137. --> Change SYS:Texts/S Intel NOCHANGE
  138.  
  139. With hex option it looks like this:
  140. --> Change SYS:Texts/S 496E74_656C NOCHANGE HEX
  141.  
  142. If you want to change Intel to Motorola you must give me a destination
  143. (SYS:Texts/S2) and remove NOCHANGE:
  144. --> Change SYS:Texts/S Intel SYS:Texts/S2 Motorola
  145.  
  146. With NOSIZE  you can also scan for intel, InTeL, INTEL and other forms,
  147. FOUND shows you the position of the string:
  148. --> Change SYS:Texts/S Intel SYS:Texts/S2 Motorola NOSIZE FOUND
  149.  
  150. Use the CD command before that, so the arguments will be shorter
  151. Befehl:
  152. --> CD SYS:Texts
  153.     Change S Intel S2 Motorola NOSIZE FOUND
  154.  
  155. If you want to replace wrong written word MoToRoLa or motorola with the 
  156. capitalized version Motorola, use this (remember NOSIZE doesn't change the
  157. destination string):
  158. --> Change S motorola S2 Motorola NOSIZE
  159.  
  160. If Intel should be replaced only at one position so use POSITION:
  161. --> Change S Intel S2 Motorola POSITION D3 NOSIZE
  162.  
  163. Alternativly use POS:
  164. --> Change S Intel S2 Motorola POS D3 NOSIZE
  165.  
  166. If the strings contain spaces use "":
  167. --> Change S "Intel is good" S2 "Motorola is better"
  168.  
  169. You can also delete the SSTRING in the file:
  170. --> Change S Intel S2 ""            or
  171. --> Change S Intel S2
  172.  
  173. If you want to replace words, which don't differ very much (Disk and Disc
  174. with floppy disc) so use a Pattern:
  175. --> Change S Dis\? S2 "floppy disc"
  176.  
  177. or
  178.  
  179. --> Change S 446973? S2 666C6F707079_64697363 HEX
  180.  
  181. If you want to search for a \ so enter they every time twice. (6 instead
  182. of 3 ...)
  183. --> Change S \\ S2 /            --> changes \ to /
  184.  
  185. --> Change S \\\\ S2 //         --> changes \\ to //
  186.  
  187. --> Change S \\? S2 /?          --> changes \? to /? (no pattern !)
  188.  
  189. but rememeber:
  190.  
  191. --> Change S \? S2 /?           --> changes every char to /?
  192.  
  193. If SSTRING is "" an error appears.
  194.  
  195. Plans for the future:
  196.  
  197. The pattern * for a variable number of chars or the standard Amiga patterns,
  198. like #, ~, ().
  199. Localisation and together with this german texts (The OS errors are already
  200. localized by the OS!).
  201.  
  202. This program is in the public domain. Use it as you want, but WITHOUT ANY
  203. WARRANTY!
  204.  
  205. Comments, wishes, money (it is Public Domain, but why not), greetings and
  206. bug reports to
  207.  
  208. ************************************************************************
  209. * snail-mail:                  * e-mail:                               *
  210. *   Dirk Stoecker              *   stoecker@amigaworld.com             *
  211. *   Geschwister-Scholl-Str. 10 *   stoecker@rcs.urz.tu-dresden.de      *
  212. *   01877 Bischofswerda        * world wide web:                       *
  213. *   GERMANY                    *   http://home.pages.de/~Gremlin/      *
  214. * phone:                       * pgp key:                              *
  215. *   GERMANY +49 (0)3594/706666 *   get with finger or from WWW pages   *
  216. ************************************************************************
  217.  
  218.