home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / fileutil / mren100.arj / MREN.DOC next >
Encoding:
Text File  |  1992-04-12  |  5.0 KB  |  102 lines

  1. Matching Rename v1.00
  2. (c)1992 Scott Vachalek
  3.  
  4.  
  5. Introduction:
  6.  
  7.      Have you ever had to do a mass renaming file by file because DOS would not
  8. allow you to do it by wildcard?  For example, suppose you have three files
  9. named BIGNAME1.DAT, BIGNAME2.DAT, and BIGNAME3.DAT, and you wanted to rename
  10. them to SHORT1.DAT-SHORT3.DAT.  You might try "REN BIGNAME?.TXT SHORT?.TXT",
  11. but you will get an error message.  What happened?  DOS searched for
  12. BIGNAME?.DAT and found the first match, BIGNAME1.DAT.  This it renamed to
  13. SHORTM.DAT because it matched the question mark in your destination filename
  14. to the character in the same position in your source filename--the "M"--rather
  15. than the character that was matched to the question mark, the digit "1".  Then
  16. using similar logic it will try to rename BIGNAME2.DAT and BIGNAME3.DAT to
  17. SHORTM.DAT as well, causing the "file exists" error.  The same problem will
  18. occur with the asterisk wildcard.  So how do you do this other than by renaming
  19. each file individually and tediously?  Matching Rename will do the job with
  20. this simple command:  "MREN BIGNAME?.TXT SHORT?.TXT".  In other words, it works
  21. just like you might have expected the DOS "REN" command to work.
  22.  
  23.  
  24. Renaming Files:
  25.  
  26.      To use Matching Rename, simply put MREN.EXE somewhere along your DOS
  27. search path and use the command "MREN" rather than "REN" whenever you need to
  28. do a renaming such as the one in the example above.  Matching Rename will
  29. replace wildcards in the destination filename, in order of occurrence, with the
  30. characters that were matched to wildcards in the source filename, in order of
  31. occurrence.  Then it will match wildcards in the destination extension with
  32. wildcards in the source extension.  If more wildcards are present in the
  33. destination name or extension than in the source name or extension, they will
  34. be completely ignored.  (This is not considered an error condition since it
  35. will occur often with asterisks; "MREN ABC* Z*" is equivalent to "MREN ABC?????
  36. Z???????" where there are only five wildcards in the source name but seven in
  37. the destination name.)
  38.  
  39.  
  40. Crossing the Dot:
  41.  
  42.      Matching Rename will usually keep name and extension wildcards separate,
  43. but there is a way to have wildcards cross the barrier between name and
  44. extension.  This will happen when you have wildcards in the destination name or
  45. extension but there were none in the source name or extension.  In this case,
  46. MREN will use the characters that were matched to the wildcards in the opposite
  47. half of the filename, if any.
  48.  
  49.  
  50. Shifting ASCII Values:
  51.  
  52.      Matching Rename will also take a third parameter if you wish to use it:
  53. a positive or negative integer to add to the ASCII values of characters
  54. associated with wildcards.  For example, "SMARTREN NAME?.DAT NEWNAME?.DAT +1"
  55. would rename NAME1.DAT-NAME8.DAT to NEWNAME2.DAT-NEWNAME9.DAT and NAMEA.DAT-
  56. NAMEY.DAT to NEWNAMEB.DAT-NEWNAMEZ.DAT.  "SMARTREN NEWNAME?.DAT NAME?.DAT -1"
  57. would reverse the operation.  This shift could turn letters into numbers (-17
  58. for A=0 or -16 for A=1) or vice versa (+17 or +16) or make other kinds of
  59. conversions.  Be careful, though, as you can accidentally rename something
  60. outside the character or number range:  "0" -1 = "@".  If you wish to shift
  61. different wildcards by different amounts (or some not at all), you can do so
  62. by breaking the rename up into as many steps as you need.  This ability can be
  63. used for anything from renumbering archives to a simple form of filename
  64. encryption:  "MREN *.* *.* 1" will make most of your filenames meaningless to
  65. the casual observer, while "MREN *.* *.* -1" will return them to their
  66. original, legible form.
  67.  
  68.  
  69. Renaming Directories or Hidden Files:
  70.  
  71.      Should you need to rename a directory or hidden file (although the latter
  72. are usually hidden in the first place to avoid tampering--be careful), you can
  73. do so with Matching Rename the same way you would rename any other file.  The
  74. only catch is that you have to explicitly state the name of the file you want
  75. to rename rather than using any kind of wildcards.  This is to ensure that you
  76. do not rename such a file accidentally.
  77.  
  78.  
  79. Summary:
  80.  
  81.      A summary of this information is available by executing Matching
  82. Rename without any parameters; i.e., just enter "MREN".
  83.  
  84.  
  85. License:
  86.  
  87.      You are free to use and copy Matching Rename as much as you like on the
  88. conditions that: (1) The executable program is accompanied by its documentation
  89. whenever a copy is made, (2) Both the program and its accompanying
  90. documentation are left completely unmodified, and (3) No charge is made for
  91. either the use or duplication of the program.  In other words, this program is
  92. free but it is -not- public domain.  All other rights to the program are
  93. retained by the author.  If you use this program on a regular basis, a small
  94. contribution to the author would be appreciated.  Please mail yours to the
  95. following address:
  96.                         Scott Vachalek
  97.                         108 Hugh Drive
  98.                         Hollywood, MD 20636
  99.  
  100.         Thank you, and enjoy the program!
  101.  
  102.