home *** CD-ROM | disk | FTP | other *** search
- Matching Rename v1.00
- (c)1992 Scott Vachalek
-
-
- Introduction:
-
- Have you ever had to do a mass renaming file by file because DOS would not
- allow you to do it by wildcard? For example, suppose you have three files
- named BIGNAME1.DAT, BIGNAME2.DAT, and BIGNAME3.DAT, and you wanted to rename
- them to SHORT1.DAT-SHORT3.DAT. You might try "REN BIGNAME?.TXT SHORT?.TXT",
- but you will get an error message. What happened? DOS searched for
- BIGNAME?.DAT and found the first match, BIGNAME1.DAT. This it renamed to
- SHORTM.DAT because it matched the question mark in your destination filename
- to the character in the same position in your source filename--the "M"--rather
- than the character that was matched to the question mark, the digit "1". Then
- using similar logic it will try to rename BIGNAME2.DAT and BIGNAME3.DAT to
- SHORTM.DAT as well, causing the "file exists" error. The same problem will
- occur with the asterisk wildcard. So how do you do this other than by renaming
- each file individually and tediously? Matching Rename will do the job with
- this simple command: "MREN BIGNAME?.TXT SHORT?.TXT". In other words, it works
- just like you might have expected the DOS "REN" command to work.
-
-
- Renaming Files:
-
- To use Matching Rename, simply put MREN.EXE somewhere along your DOS
- search path and use the command "MREN" rather than "REN" whenever you need to
- do a renaming such as the one in the example above. Matching Rename will
- replace wildcards in the destination filename, in order of occurrence, with the
- characters that were matched to wildcards in the source filename, in order of
- occurrence. Then it will match wildcards in the destination extension with
- wildcards in the source extension. If more wildcards are present in the
- destination name or extension than in the source name or extension, they will
- be completely ignored. (This is not considered an error condition since it
- will occur often with asterisks; "MREN ABC* Z*" is equivalent to "MREN ABC?????
- Z???????" where there are only five wildcards in the source name but seven in
- the destination name.)
-
-
- Crossing the Dot:
-
- Matching Rename will usually keep name and extension wildcards separate,
- but there is a way to have wildcards cross the barrier between name and
- extension. This will happen when you have wildcards in the destination name or
- extension but there were none in the source name or extension. In this case,
- MREN will use the characters that were matched to the wildcards in the opposite
- half of the filename, if any.
-
-
- Shifting ASCII Values:
-
- Matching Rename will also take a third parameter if you wish to use it:
- a positive or negative integer to add to the ASCII values of characters
- associated with wildcards. For example, "SMARTREN NAME?.DAT NEWNAME?.DAT +1"
- would rename NAME1.DAT-NAME8.DAT to NEWNAME2.DAT-NEWNAME9.DAT and NAMEA.DAT-
- NAMEY.DAT to NEWNAMEB.DAT-NEWNAMEZ.DAT. "SMARTREN NEWNAME?.DAT NAME?.DAT -1"
- would reverse the operation. This shift could turn letters into numbers (-17
- for A=0 or -16 for A=1) or vice versa (+17 or +16) or make other kinds of
- conversions. Be careful, though, as you can accidentally rename something
- outside the character or number range: "0" -1 = "@". If you wish to shift
- different wildcards by different amounts (or some not at all), you can do so
- by breaking the rename up into as many steps as you need. This ability can be
- used for anything from renumbering archives to a simple form of filename
- encryption: "MREN *.* *.* 1" will make most of your filenames meaningless to
- the casual observer, while "MREN *.* *.* -1" will return them to their
- original, legible form.
-
-
- Renaming Directories or Hidden Files:
-
- Should you need to rename a directory or hidden file (although the latter
- are usually hidden in the first place to avoid tampering--be careful), you can
- do so with Matching Rename the same way you would rename any other file. The
- only catch is that you have to explicitly state the name of the file you want
- to rename rather than using any kind of wildcards. This is to ensure that you
- do not rename such a file accidentally.
-
-
- Summary:
-
- A summary of this information is available by executing Matching
- Rename without any parameters; i.e., just enter "MREN".
-
-
- License:
-
- You are free to use and copy Matching Rename as much as you like on the
- conditions that: (1) The executable program is accompanied by its documentation
- whenever a copy is made, (2) Both the program and its accompanying
- documentation are left completely unmodified, and (3) No charge is made for
- either the use or duplication of the program. In other words, this program is
- free but it is -not- public domain. All other rights to the program are
- retained by the author. If you use this program on a regular basis, a small
- contribution to the author would be appreciated. Please mail yours to the
- following address:
- Scott Vachalek
- 108 Hugh Drive
- Hollywood, MD 20636
-
- Thank you, and enjoy the program!
-
-