home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 49
/
Amiga_Dream_49.iso
/
amiga
/
workbench
/
commodoties
/
case.lha
/
Case
/
case.doc
< prev
next >
Wrap
Text File
|
1998-01-27
|
78KB
|
2,048 lines
*****************************************************************************
** Case 2.2 - Filename Changer - by Erik Spσre (Parsec/Phuture 303) 980127 **
** Filematching routines by Anders Vedmar (Axehandle/PC303) **
*****************************************************************************
A POEM
A good night.
A good night for nothing, indeed.
Tonight nothing will happen, here I can code alone, no one
will disturb me.
Here I can code in peace and await my own dear death.
Here I can sit and think of the world, as if I was a part of
it, as if I meant something to somebody else.
As if there was a meaning with this short and boring life.
(Originally in Swedish by Gunnar Lundkvist. Slightly modified.)
EXCITING BACKGROUND STORY
One day, when I was removing all uppercases (by hand) from a
few hundred modules on my harddrive, I thought to myself
(constantly): "Why haven't someone made a utility for this?"
I can't be the only person to dislike long lists of filenames,
some uppercase, some lowercase, and some a little of both.
I decided to do the world a favour, I started to code on
Case...
WHAT CAN CASE DO FOR YOU?
Compare these two lists...
MOD.OCEAN_LOADER_FIXED mod.ocean_loader_fixed
Mod.Green beret mod.green_beret
mod.CRYSTAL HAMMER mod.crystal_hammer
DOC1 mod.doc1
Hunters_moon mod.hunters_moon
MOD.SleepWalk mod.sleepwalk
MOD.(((nebulos))) mod.nebulos
mod.CREAM OF THE EARTH mod.cream_of_the_earth
MOD.telephone!!! mod.telephone
If you prefer the left one, or don't care, then this is not a
utility for you. (Maybe you are one of those who chat with
capital letters...) You must be a little of a perfectionist,
or a design-freak, to understand why the left list is so
*revaulting*
In this case I used the following options to produce the right
list:
Case -l -t -k -apmod modules:old/#?
-l to make all chars lowercase, -t to transform the spaces to
underlines, -k to keep only the letters and numbers (thus
removing '(' and '!') and -apmod to Add the Prefix mod (if it
isn't there already).
If you can see my point, but don't like the right list either,
then don't worry -- there is probably one or more options that
is more suitable to your taste...
REQUIREMENTS
OS2.04 or above (because of the filematching routines).
CASE IS...
100 % assembler
Freeware
REMEMBER...
"This should be in every man's c-directory."
/ Axehandle.
MORE USEFUL INFORMATION ABOUT CASE
Usage: Case -<OPTIONS> [<FILEPATTERN>] [ALL]
The options you specify must all start with the minus sign.
If there is an argument given after the option there must be
NO spaces between them. If there's several strings that can
be given, use comma to separate them. Still no spaces.
Everything that is written after the last -option and before
the optional 'all' (to recurse) is assumed to be the filename/
filepattern.
If you don't write a file specification, #? (or *) will be
used.
Recognized as lowercase letters (thus possible to uppercase):
abcdefghijklmnopqrstuvwxyzαßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷°∙·√ⁿ²
Recognized as uppercase letters (and possible to lowercase):
ABCDEFGHIJKLMNOPQRSTUVWXYZ└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╪┘┌█▄▌
And just recognized as a letter (not possible to lowercase):
▀
LIST OF OPTIONS
Here are all the options. They are sorted in four categories.
They will be explained in detail later.
The caseing options
-l All Lowercase
-u All Uppercase
-c Change cases
-w Each new Word uppercase
-f First letter uppercase
-i Ignore suffix and/or prefix when caseing
-I Don't Ignore suffix and/or prefix when caseing
The extention operations
-a Add specified prefix/suffix/extention
-r Remove [specified] prefix/suffix/extention
-C Change [given] pref/suff/ext to specified
-s Swap prefix and/or suffix
-E Ignore default extensions [only accept specified]
-e Only accept default extentions [and specified]
-L Set new prefix and/or suffix maxlength
-g Give priority to prefix or suffix
The string manipulation operations
-t Transform spaces to underlines
-T Transform underlines to spaces
-d Delete all the spaces [or only specified]
-D Delete specified strings
-C Change string 1 to string 2
-k Keep letters, digits, some more [and specified]
-K Keep A-Z, digits, some more [and specified]
-m Mutilate chars with ASCI values exceeding 128 to 45-127
-a Add head/tail string to filename
-r Remove head/tail string from filename
-v Vomit files to PC-format
The remaining options
-D Disable env:caseopts file
-q Be Quiet (only list errors)
-n Neglect the directories
-b Use a buffer when renaming (indirect)
-B Don't use a buffer when renaming (direct)
-S Simulate caseing, don't actually rename anything
ALL To recurse into subdirs.
As a rule, if an option can be either on or off, the negative
form will be an uppercased letter, and the positive a lowercased.
HOW CASE WORKS, ORDER OF EXECUTION...
If Case is in indirect mode (which it is unless you use the -B
option) all matching files will be read to a buffer. If it is in
indirect mode, one matching file at a time will be cased.
First the -C" option will be called. (Change strings)
Then the -m option (mutilate).
At this point, all found extentions will be stripped from the
filename, if this has not been disabled somehow. Most of the options
will not be given a chance to operate on the extentions from now on,
unless, of course, the option is only intended for extentions.
The -l/u/f/w/c options are called. These may or may not affect
the extentions, depending on the settings. Note that the extention
specific variants of these options are not executed now.
The -d option (delete spaces and/or specified chars)
The -D option (delete strings).
Next out is the -k (keep only letters and specified) or -K option
(keep only a-z and specified); only one of these can be called
per session, for obvious reasons...
Now the filetype will be checked: is it a file or a directory?
If it's a directory, the following options will be skipped...
The -C<%> option (change extention)
The -r option (remove extention or head/tail string). Note that
this means that head/tail strings cannot be removed from
directory names.
The -a option (add extention or head/tail string). Again, this
means that head/tail strings cannot be added to directory names.
The -s option (swap prefix and/or suffix)
And finally the extention specific variants of the -l/u/f/w/c
options are called.
Now when the extention-specific operations have been performed there's
only one more operation left to do on both files and directories.
It's the -v option (vomit files to PC format). Note that most of
what this option does has already been done, since it turns on a
bunch of other options. The only thing it does now is to truncate
the name and/or any recognized extentions.
Finally all the extentions and head/tail strings are merged into one
single name. First I copy any found/added prefix, then add a header
string if that was desired (so no other options have actually a
chance to affect the header string you specified). Directly after
this the possibly modified filename, followed by a tailstring (same
thing with this) and the suffix.
If the resulting filename differs from the source filename, the file
is renamed unless it's too long.
THE ENV:CASEOPTS FILE
Before Case starts to interprete the commandline, it will try
to load env:caseopts. If this file is found its contents are
interpreted just as the argument-line's are.
RECOGNIZED EXTENTIONS
Graphics extentions
qt
avi, brs, iff, gif, jpg, mpg, raw
anim, ilbm, jpeg
Music extentions
xm
med, mod, mp3, p61, s3m
symmod
Archive-related extentions
gz, pp
arc, arj, bz2, dms, lha, lzx, tar, xpk, zip, zoo, tgz, lzh
gzip
Programming-related extentions
c, E, i, o, s
asm, c++, cpp, obj
rexx
Text-related extentions
pi
bbs, diz, doc, htm, lst, man, nfo, tex, txt
html, text
amiga, guide
readme
displayme
Misc extentions
bin, dat, env, exe
info
prefs
I couldn't think of any more... If you miss one, then
complain to me and/or add it in the env:caseopts file
with -e<extention>.
SYMBOLS USED IN THE SYNTAX
[] Everything within brackets are optional.
(h|t) Write either 'h' (for header string) or 't' (for
tail string).
<%> Short form for (s|p|e) (or (S|P|E), it doesn't matter), an
extention specification. Use 's' (suffix), 'p' (prefix) or
'e' for both.
<c> Means a character. For example 'p' or '!'
<c>.. Means one or more characters, a = 'a' or abc = 'a','b','c'
<$> Means a string. You usually don't have to enclose a string
with single or double quotes, but sometimes it's a must.
If you start it with a double quote, you must end it with
a double quote. Same thing with single quotes.
Valid strings: ab (ab), "1,3" (1,3), '# %' (# %),
"'o'" ('o'), '/"\' (/"\), rab" (rab")
Invalid strings: "hm' 'bla oof, """ '"'"'
<$>,.. Means that you must specify one or more strings, separated
by commas. This is ok: "rab",'oof' and Case would
interpretate it as the two strings rab and oof.
<#> Denotes ONE digit, 1-9.
I call a prefix something that precedes the filename with a dot,
for instance mod.#?
I call a suffix something that follows the filename with a dot,
for instance #?.txt
When I say extention I mean either a prefix or a suffix.
**********************************************************************
** THE CASING OPTIONS **
** (l, u, c, w, f, i, I) **
**********************************************************************
-l NAME All lowercase
SYNTAX -l[<%>]
ARGUMENTS Give an extention specification if you only want
this operation to affect prefixes and/or suffixes.
TASK Lowercase all the characters in a filename and/or
its extentions.
FUNCTION All the names that match will be lowercased, including
their prefixes and suffixes. If you don't want the
extensions to be affected by this operation, use the
-i option.
AFFECTS u, w, f, c, I, i
u (All uppercase) -- Turned off
w (Each new word uppercase) -- Turned off
f (First letter uppercase) -- Turned off
c (Change cases) -- Turned off
i(*)(Ignore suffix and/or prefix when caseing) -- turned off.
Use this in conjunction with the -l option to
perform the operation on the filename only.
I(*)(Don't Ignore suffix and/or prefix when caseing) -- on.
This is so that the extentions won't be stripped off
the filename, before the caseing starts (as they
are when the -w and -f options are executed).
(*) The -I and -i options are not touched when this mode
is started as an extention operation only.
EXAMPLE 1 Case -l "mOd.DeT_VAR_en.PP"
Target ^^^^^^^^^^^^^^^^
Result "mod.det_var_en.pp"
EXAMPLE 2 Case -le "mOd.DeT_VAR_en.PP"
Target ^^^ ^^
Result "mod.DeT_VAR_en.pp"
-u NAME All uppercase
SYNTAX -u[<%>]
ARGUMENTS Give an extention specification if you only want
this operation to affect prefixes and/or suffixes.
TASK Uppercase all the characters in a filename and/or
its extentions.
FUNCTION All the names that match will be uppercased, including
their prefixes and suffixes. If you don't want the
extensions to be affected by this operation, use the
-i option.
AFFECTS u, w, f, c, I, i
u (All uppercase) -- Turned off
w (Each new word uppercase) -- Turned off
f (First letter uppercase) -- Turned off
c (Change cases) -- Turned off
i(*)(Ignore suffix and/or prefix when caseing) -- turned off.
Use this in conjunction with the -u option to
perform the operation on the filename only.
I(*)(Don't Ignore suffix and/or prefix when caseing) -- on.
This is so that the extentions won't be stripped off
the filename, before the caseing starts (As they
are when the -w and -f options are executed).
(*) The -I and -i options are not touched when this mode
is started as an extention operation.
EXAMPLE 1 Case -u "mOd.Ensam_GNU.pp"
Target ^^^^^^^^^^^^^^^^
Result "MOD.ENSAM_GNU.PP"
EXAMPLE 2 Case -up "mOd.Ensam_GNU.pp"
Target ^^^
Result "MOD.Ensam_GNU.pp"
-c NAME Change cases
SYNTAX -c[<%>]
ARGUMENTS Give an extention specification if you only want
this operation to affect prefixes and/or suffixes.
TASK Change cases on the characters in a filename and/or
its extentions.
FUNCTION All the names that match will change cases, including
the prefixes and suffixes. If you don't want the
extensions to be affected by this operation, use the
-i option.
AFFECTS l, u, w, f, I, i
l (All lowercase) -- Turned off
u (All uppercase) -- Turned off
w (Each new word uppercase) -- Turned off
f (First letter uppercase) -- Turned off
i(*)(Ignore suffix and/or prefix when caseing) -- turned off.
Use this in conjunction with the -c option to
perform the operation on the filename only.
I(*)(Don't Ignore suffix and/or prefix when caseing) -- on.
This is so that the extentions won't be stripped off
the filename, before the caseing starts (As they
are when the -w and -f options are executed).
(*) The -I and -i options are not touched when this mode
is started as an extention operation.
EXAMPLE 1 Case -c "mOd.Ensam_GNU.pp"
Target ^^^^^^^^^^^^^^^^
Result "MoD.eNSAM_gnu.PP"
EXAMPLE 2 Case -ce "mOd.Ensam_GNU.pp"
Target ^^^ ^^
Result "MoD.Ensam_GNU.PP"
-w NAME Each new word uppercase
SYNTAX -w[<%>]
ARGUMENTS Give an extention specification if you only want
this operation to affect prefixes and/or suffixes.
TASK Uppercase the first letter in the filename's (and/or its
extentions) every word, lowercase the rest.
FUNCTION Every matching file will be stripped from its
extensions, the remaining part will then be cased. The
first letter in every word will be uppercased, all the
other lowercased. New words are distinguished by a
non-letter e.g a space, underscore, digit, questionmark
etc (Characters not in the "recognized letters" list).
The extentions are by default not affected.
AFFECTS l, u, f, c, i, I
l (All lowercase) -- Turned off
u (All uppercase) -- Turned off
f (First letter uppercase) -- Turned off
c (Change cases) -- Turned off
i(*)(Ignore suffix and/or prefix when caseing) -- Turned on.
This is so that the extentions will be stripped
from the filename (when they are not ignored they
remain with it), before the caseing starts. It
looks (in my opinion) ugly when the extentions
are treated as a word, and cased...
I(*)(Don't Ignore suffix and/or prefix when caseing) -- off.
The extentions are by default not included in
the -w casing; if you want them to be, use this
option.
(*) The -I and -i options are not touched when this mode
is started as an extention operation.
EXAMPLE 1 Case -w "mod.lo!in_this222i am.pp"
Target ^^^^^^^^^^^^^^^^^
Result "mod.Lo!In_This222I Am.pp"
EXAMPLE 2 Case -ws "mod.lo!in_this222i am.pP"
Target ^^
Result "mod.lo!in_this222i am.Pp"
-f NAME First letter uppercase
SYNTAX -f[<%>]
ARGUMENTS Give an extention specification if you only want
this operation to affect prefixes and/or suffixes.
TASK Uppercase the first found letter in the filename (and/or
its extentions), lowercase the rest.
FUNCTION Every matching file will be stripped from its
extensions, the remaning part will then be cased. The
first letter found will be uppercased, all the other
lowercased. The extentions are by default not
affected.
AFFECTS l, u, w, c, i, I
l (All lowercase) -- Turned off
u (All uppercase) -- Turned off
w (Each new word uppercase) -- Turned off
c (Change cases) -- Turned off
i(*)(Ignore suffix and/or prefix when caseing) -- Turned on.
This is so that the extentions will be stripped
from the filename (when they are not ignored they
remain with it), before the caseing starts. It
looks (in my opinion) ugly when the extentions
are treated as a word, and cased...
I(*)(Don't Ignore suffix and/or prefix when caseing) -- off.
The extentions are by default not included in
the -w casing; if you want them to be, use this
option.
(*) The -I and -i options are not touched when this mode
is started as an extention operation.
EXAMPLE 1 Case -f "mod.lO!In_This222I Am.pp"
Target ^^^^^^^^^^^^^^^^^
Result "mod.Lo!in_this222i am.pp"
EXAMPLE 2 Case -fp "mOd.lO!In_This222I Am.pp"
Target ^^^
Result "Mod.lO!In_This222I Am.pp"
-i NAME Ignore suffix and/or prefix when caseing
SYNTAX -i[<%>]
ARGUMENTS s Ignore suffixes only.
p Ignore prefixes only.
e or -i alone ignores both the suffixes and prefixes.
TASK To tell the -l/u/c options what to operate on.
FUNCTION The -i option is _only_ useful in conjunction with the
-l/u/c options. When you use -i it will force the casing
operations to operate on only the filename (and one
extention, if requested). If you don't like the
default fact that the -l/u/c options case the whole
filenames, with extentions, use -i.
AFFECTS l, u, c, I
l (All lowercase) -- Will cause the -l casing to be
conducted on only the filename (and possibly one
extention).
u (All uppercase) -- As above.
c (Change cases) -- As above.
I (Don't ignore suffix and/or prefix) -- Turned off.
EXAMPLE 1 Case -i -l "MOD.INTO_PERSONA1.PP"
Target ^^^^^^^^^^^^^
Result "MOD.into_persona1.PP"
EXAMPLE 2 Case -ip -l "MOD.INTO_PERSONA1.PP"
Target ^^^^^^^^^^^^^^^^
Result "MOD.into_persona1.pp"
EXAMPLE 3 Case -is -u "mod.into_persona1.pp"
Target ^^^^^^^^^^^^^^^^^
Result "MOD.INTO_PERSONA1.pp"
-I NAME Don't ignore suffix and/or prefix when caseing
SYNTAX -I[<%>]
ARGUMENTS s Don't ignore suffixes.
p Don't ignore prefixes.
e or -I alone will make sure that neither suffix nor
prefix will be ignored.
TASK To tell the -f/w options what to operate on.
FUNCTION The -I option is, _only_ useful in conjunction with the -w/f
options. When you use -I it will force the casing operations to
operate on the filename, the prefix (-I, -IE or -IP) and/or
the suffix (-I, -IE or -IS). If you don't like the default
values of the w/f options, use -I.
AFFECTS w, f, i
w (Each new word uppercase) -- The extentions will
be treated just as the filename, and the caseing
thus conducted on the whole (or part of the whole,
depending on the -I setting).
f (First letter uppercase) -- As above.
i (Ignore suffix and/or prefix) -- Turned off.
EXAMPLE 1 Case -IE -w "MOD.TEARS_OF_THE_FOREST.PP"
Target ^^^^^^^^^^^^^^^^^^^^^^^^^^
Result "Mod.Tears_Of_The_Forest.Pp"
EXAMPLE 2 Case -Ip -f "MOD.TEARS_OF_THE_FOREST.PP"
Target ^^^^^^^^^^^^^^^^^^^^^^^
Result "Mod.tears_of_the_forest.PP"
EXAMPLE 3 Case -Is -w "MOD.TEARS_OF_THE_FOREST.PP"
Target ^^^^^^^^^^^^^^^^^^^^^^
Result "MOD.Tears_Of_The_Forest.Pp"
**********************************************************************
** THE EXTENTION OPERATIONS **
** (a, r, C, s, E, e, L, g) **
**********************************************************************
-a NAME Add specified prefix/suffix/extention
SYNTAX -a<%><$>
ARGUMENTS p Add prefix
s Add suffix
e Add extention
<$> Directly after the -a<%> (no space) is the name of
the prefix/suffix/extention to add.
TASK To add an extention to the filename
FUNCTION The extention will be added to a name, if it does not
exist already. If it does exist, but not exactly as
specified, the extention name will be adjusted. Meaning,
if you add `mod' and a name contains the prefix `MOD'
it is renamed to the desired `mod'.
NOTE The specified extention will be added to the list of
recognized extentions. If you use this option with -E it
will not be recognized.
AFFECTS L (Set new prefix and/or suffix maxlength) -- The
extention options will change the maximum allowed
length of an extention _if_ a specified one's
length exceeds the current maxlength. Remember
that the -L option is only used when the -e
option is turned off (which it isn't unless you
disable it by -E)
EXAMPLES Case -apmod "mahlzeit" => "mod.mahlzeit"
Case -apmOd "mod.mahlzeit" => "mOd.mahlzeit"
Case -apmod "npu.mahlzeit" => "mod.npu.mahlzeit"
Case -apmod "mod.mahlzeit" => [NO CHANGE]
Case -aetxt "wonderland" => "txt.wonderland.txt"
Case -asTxT "wonderland.txt" => "wonderland.TxT"
Case -aspp "wonderland.txt" => "wonderland.txt.pp"
Case -astxt "wonderland.txt" => [NO CHANGE]
-r NAME Remove [specified] prefix/suffix/extention
SYNTAX -r<%>[<$>]
ARGUMENTS p Add prefix
s Add suffix
e Add extention
<$> Directly after the -r<%> (no space) you can specify
the name of the extention to remove.
TASK To remove an extention from the filename.
FUNCTION If no extention is specified, all (recognized) extentions
will be removed. If you want to remove all extentions,
regardless whether this program recognize them or not
(like "prc.mymodule"), then you better use the -E
option. (You may need the -L option as well). If you
specify an extention, only files containing that extention
will have it removed (the check is not case-sensitive).
NOTE If you specify an extention it will be added to the list of
recognized extentions. If you use this option with -E it
will not be recognized.
AFFECTS L (Set new prefix and/or suffix maxlength) -- The
extention options will change the maximum allowed
length of an extention _if_ a specified one's
length exceeds the current maxlength. Remember
that the -L option is only used when the -e
option is turned off (which it isn't unless you
disable it by -E)
EXAMPLES Case -rpMOD "mod.mahlzeit" => "mahlzeit"
Case -rpmed "mod.mahlzeit" => [NO CHANGE]
Case -rp "med.mahlzeit.lzx" => "mahlzeit.lzx"
Case -re "med.mahlzeit.lzx" => "mahlzeit"
Case -rsTXT "wonderland.txt" => "wonderland"
Case -rstxt "wonderland.txt.pp" => [NO CHANGE]
Case -rs "wonderland.txt.pp" => "wonderland.txt"
-C NAME Change [given] pref/suff/ext to specified
SYNTAX -C<%>[<$>,]<$>
ARGUMENTS p Change only prefixes
s Change only suffixes
e Change all extentions
<$> If only one extention is given, it is assumed to be the
target. If two are given, the first one is the source.
TASK To change extentions' names
FUNCTION If no source is specified: All recognized extentions will be
changed to the destination.
If a source is specified: Only the extentions that match the
source (the first given extention) will be changed to the
destination.
NOTE Any specified extentions will be added to the list of
recognized extentions. If you use this option with -E they
will not be recognized.
AFFECTS L (Set new prefix and/or suffix maxlength) -- The
extention options will change the maximum allowed
length of an extention _if_ a specified one's
length exceeds the current maxlength. Remember
that the -L option is only used when the -e
option is turned off (which it isn't unless you
disable it by -E)
EXAMPLES Case -Cpmed,mod med.hummeln2.pp => mod.hummeln2.pp
Case -CsPP,mod med.hummeln2.pp => mod.hummeln2.mod
Case -CpPP,mod med.hummeln2.pp => [NO CHANGE]
Case -Cemod med.hummeln2.pp => mod.hummeln2.mod
-s NAME Swap prefix and/or suffix
SYNTAX -s[<%>]
ARGUMENTS p Swap prefixes to suffixes.
s Swap suffixes to prefixes.
e or -s alone swaps both the suffix and prefix.
TASK To swap the extentions' positions.
FUNCTION Unless selected otherwise (with p or s) the recognized
prefixes will be changed to suffixes and vice versa.
AFFECTS None
EXAMPLES Case -s "pp.remix101.lfo.mod" => "mod.remix101.lfo.pp"
Case -sp "pp.remix101.lfo.mod" => "remix101.lfo.mod.pp"
Case -ss "pp.remix101.lfo.mod" => "mod.pp.remix101.lfo"
-E NAME Ignore default extensions [only accept specified]
SYNTAX -E[<$>,..]
ARGUMENTS <$> Directly after the -E it is possible to specify
one or more extentions that will be the _only_
recognized extentions.
TASK Change the criteria for extention recognition, forget
the default extentions.
FUNCTION If no argument is given then Case will ignore its
internal list of valid extentions and treat all 1-3
letter strings (or more if specified) that is
separated from the filename with "." as extentions.
If one or more extention is specified after the -E,
then _only_ those will be recognized.
AFFECTS -e (Only accept default extentions) -- Turned off.
EXAMPLE 1 Case -re "mod.remix101.lfo" => "remix101.lfo"
Remove extentions. Only mod is recognized as an
extention, and properly removed.
EXAMPLE 2 Case -re -E "mod.remix101.lfo" => "remix101"
Now both mod and lfo are recognized as extentions, and
removed.
EXAMPLE 3 Case -re -Elfo "mod.remix101.lfo" => "mod.remix101"
This tells Case that the only valid extention is lfo,
and as such it is removed.
-e NAME Only accept default extentions [and specified]
SYNTAX -e[<$>,..]
ARGUMENTS <$> Directly after the -e it is possible to specify
one or more additional extentions to recognize.
TASK Change the criteria for extention recognition, always
recognize the default extentions.
FUNCTION -e is used by default, so there is no point in
writing it, unless -E is present in env:caseopts.
It does not disable previous -e adds.
All extentions specified after the -e is added to the
list of recognized extentions. It is possible to
add extentions with -e both in env:caseopts and the
argument line.
AFFECTS -E (Ignore default extensions) -- Turned off.
EXAMPLE 1 Case -re "mod.remix101.lfo" => "remix101.lfo"
Remove extentions. Only mod is recognized as an
extention, and properly removed.
EXAMPLE 2 Case -re -eprc,lfo "mod.remix101.lfo" => "remix101"
Now both mod and lfo are recognized as extentions, and
removed. The fictive extention prc would also have
been removed if it had been found.
EXAMPLE 3 Case -re -elfo "pco.remix101.lfo" => "pco.remix101"
The suffix lfo is recognized and removed, the alien
prefix pco is ignored.
-L NAME Set new prefix and/or suffix maxlength
SYNTAX -L[<%>]<#>
ARGUMENTS p Only change the prefix maxlength.
s Only change the suffix maxlength.
e or -L<#> alone changes both the suffix & prefix maxlength.
<#> A number between 1 and 9; the new maxlength.
TASK Change the criteria for extention recognition (if -E
is used).
FUNCTION This is an option that will probably never be used by
anyone. Nevertheless, this is what it does: First, it
is _only_ consulted if the -E (ignore default
extentions) mode is on. If it is, all 1-3 letter
strings enclosing the filename with "." will be
treated as extentions. The 3 letter limit (default)
makes the recognition more safe. However, in some
cases you may want to change the length, so that, for
instance, strange 4-letter suffixes (not normally
recognized by Case) can be removed or whatever. In
Case 1.0 you needed to use this option if you removed
specified 4-9 letters extentions, but lo! That is not
necessary anymore. (The maxlength is now adjusted after
the longest specified extention. Could that be a
nuisance sometimes? I don't know, but if so, use
-L after the extentions).
AFFECTS None
EXAMPLE 1 Case -re -E -L4 "this.orthis" => "orthis"
Remove extentions, ignore default extentions.
`this' is 4 chars, and is treated as a prefix and
properly removed.
EXAMPLE 2 Case -re -E -L2 "mod.raveland.pp" => "mod.raveland"
As example 1, but now the maximum allowed extention
length is only 2 letters, so the prefix mod is
ignored.
EXAMPLE 3 Case -re -E -Lp6 "parsec.aha.parsec" => "aha.parsec"
The prefixes are now allowed to be upto 6 letters,
but not the suffixes, which are left untouched.
-g NAME Give priority to Prefix or Suffix
SYNTAX -g(p|s)
ARGUMENTS p Give priority to the prefixes
s Give priority to the suffixes
TASK Tell what extention that has "the last word".
FUNCTION Sometimes a filename containing only one point (.) may
nevertheless present two valid extentions. For
instance a file called mod.txt would confuse Case, a
little. Luckily it checks what extention that has the
priority, and gives it authority to do whatever it
pleases. By default the suffixes has the priority,
because they are more common than the prefixes.
However, the priority is changed each time you specify
a suffix/prefix operation; for instance, if you tell
Case to remove all prefixes, the priority will be
given to them. Same with E, L, r, a... They give
the priority to their own target. If you specify
several of these, the last written is the last to
change the priority. This is not the case with -g
though, no matter where you write it, it will always
give the priority you command.
AFFECTS None
EXAMPLE 1 Case -rp -rs "mod.pp" => "mod"
The -rs is written last, the priority is given to the
suffixes.
EXAMPLE 2 Case -rs -rp "mod.pp" => "pp"
Now the -rp was written last. Priority to the prefixes.
EXAMPLE 3 Case -gs -rs -rp "mod.pp" => "mod"
The -gs overrides the last priority change and the
priority is given to the suffixes.
**********************************************************************
** THE STRING MANIPULATION OPERATIONS **
** (t, T, d, D, C, k, K, m, a, r, v) **
**********************************************************************
-t NAME Transform spaces to underlines
SYNTAX -t
ARGUMENTS None
TASK To connect words separated by spaces
FUNCTION All spaces in the filenames (recognized extentions not
affected) will be transformed to underlines (_).
AFFECTS -T (Transform underlines to spaces) -- Turned off.
EXAMPLE Case -t "mod.one two three" => "mod.one_two__three"
-T NAME Transform underlines to spaces
SYNTAX -T
ARGUMENTS None
TASK To replace underlines (_) by spaces.
FUNCTION All underlines in the filenames (recognized extentions
not affected) will be transformed to spaces.
AFFECTS -t (Transform spaces to underlines) -- Turned off.
EXAMPLE Case -T "mod.one_two__three" => "mod.one two three"
-d NAME Delete all the spaces [or only specified]
SYNTAX -d[<c>..]
ARGUMENTS <c> If you specify one or more characters, directly after the
-d (no spaces), only these characters will be deleted.
TASK To compress several words into one, or strip ugly characters
from the filenames.
FUNCTION If you write -d alone, all spaces in the filenames (recognized
extentions not affected) will be deleted. If you specify one or
more characters after the -d, _only_ those will be deleted.
Spaces will in that case not be removed. If you want to delete
both $ and spaces, you have to write -d -d$.
NOTE Characters written in one or more previous -r:s will be
remembered.
AFFECTS None
EXAMPLES Case -d "mod.one two three" => "mod.onetwothree"
Case -d() "mod.(((nebulos)))" => "mod.nebulos"
-D NAME Delete specified string[s]
SYNTAX -D<$>,..
ARGUMENTS <$> The unwanted string or strings. If you specify several
strings, separate them with commas (no spaces!). If you
want to include a comma or space, enclose the string with
single (') or double (") quoutes. If you want to remove
a string that begins with a single quoute, you must
enclose the whole string with double quoutes. Likewise, if
you want to remove a string that begins with a " you must
enclose the whole string with single quotes.
TASK To remove ugly/unwanted strings from the filenames.
FUNCTION The specified string(s) are removed from the filenames.
The search is not case-sensitive.
NOTE Strings written in a previous -D will _not_ be
remembered. In other words, it is not possible to
"add" more strings to remove.
AFFECTS None
EXAMPLE Case -D[lfo] "mod.[LFO]delta_rave" => "mod.delta_rave"
Case -D"don't ",bla "mod.don't saybla" => "mod.say"
-C NAME Change string one to string two
SYNTAX -C"<$>",<$>
ARGUMENTS "<$>" The first string is the "source", the string you want
to change. You MUST place the _first_ string within single
or double quoutes, to separate it from the -C<%><$>[,<$>]
option.
<$> The second string is the "destination", what you want the
first string to be. Does not have to be quoted.
TASK To change one string into another.
FUNCTION Before any extentions are stripped from the filename, it will
be checked for matches of the given source string
(case-insensitive). If found, the following will happen:
If the source string is of the same length as the dest string
and the found string doesn't match the destination string
exactly (only case insensitive), it is replaced. If the source
string's length differ from the destinations string's, a
replacement always takes place. And the caseing goes on...
NOTE #1 This function does not care about extentions, it will conduct
it's search on the whole filename.
NOTE #2 You can only have one string substitution per session. If you
specify several, only the last will be given a chance.
AFFECTS None
EXAMPLES Case -C"don't",do "I don't want to live" => "I do want to live"
Case -C"bla.med",mod "bla.med.oofrab" => "mod.oofrab"
-k NAME Keep letters, digits [and specified]
SYNTAX -k[<c>..]
ARGUMENTS <c> Additional char -- or chars -- to keep.
TASK Keep only letters & numbers, thus removing ugly chars.
FUNCTION This option will strip eccentric characters from your
filenames. It will only keep letters, numbers, dots,
underlines, spaces and all the characters you specify
directly after the -k.
NOTE All characters written earlier (whether it's on the k
or K) will _not_ be remembered. In other words, it's not
possible to "add" more characters to keep.
AFFECTS -K (Keep A-Z, digits [and specified]) -- Turned off.
EXAMPLE Case -k$! "«╪⌐! Par$ec-222_ah!" => "╪! Par$ec222_ah!"
-K NAME Keep A-Z, digits [and specified]
SYNTAX -K[<c>..]
ARGUMENTS <c> Additional char -- or chars -- to keep.
TASK Keep only A-Z & numbers, thus removing ugly chars.
FUNCTION This option will strip eccentric characters from your
filenames. It will only keep the letters A-Z (unlike
its sister-option -k), numbers, underlines, spaces, dots
and all the characters you specify directly after the -K.
NOTE All characters written earlier (whether it's on the k
or K) will _not_ be remembered. In other words, it's not
possible to "add" more chars to keep.
AFFECTS -k (Keep letters, digits [& specified]) -- Turned off.
EXAMPLE Case -K$! "µ«╪! Par$ec-222_ah!" => "! Par$ec222_ah!"
-m NAME Mutilate chars with ASCI value exceeding 128 to 0-127
SYNTAX -m
ARGUMENTS None
TASK Convert phonems and such to their stem-letters
FUNCTION Since ASCII values of 128-255 are not an international
standard, filenames containing that may come to look strange
on another OS. This option will try to "make the best of it",
so for instance σ will become a, ╓ => O, Θ => e etc. All
non-letters will become a dash (-).
NOTE #1 -m, -n and -S are currently the _only_ options that turn on
themselves by inverting the current value (by default
zero=NOP). This means that if you write -m -m it will be
turned on and then immediately disabled. This is only useful
if you have the -m written in the env:caseopts file,
and then temporarily want to rename some directories.
NOTE #2 This option is performed on the whole filename, including
extentions.
AFFECTS None
EXAMPLE Case -m "tΣnd pσ!" => "tand pa!"
-a NAME Add head or tail string to filename
SYNTAX -a(h|t)<$>
ARGUMENTS h Add a header string
t Add a tail string
<$> String to add
TASK To add a string to start or end of the filename.
FUNCTION This option is actually very useful -- not only when
you are adding your handle to a group of files, but
when you want to lengthen a filename for some (very
common) reason. I use this a lot. The header is not
placed before any (recognized) prefix, and the tail
not after any suffix. The string to insert is not
inserted if it is already there. This works the same
way as the prefix/suffix adds in that the check is not
case-sensitive; if the string match case-insensitive,
but not case-sensitive, it is not added, but adjusted.
NOTE You can only add one header, and only one tail per
session. It is not possible to add tails or headers to
directories.
AFFECTS None
EXAMPLES Case -ah[LFO] "mod.jungle" => "mod.[LFO]jungle"
Case -ah[lfo] "mod.[LFO]jungle" => "mod.[lfo]jungle"
Case -ah[lfo] "mod.[lfo]jungle" => [NO CHANGE]
-r NAME Remove head/tail string from filename
SYNTAX -r(h|t)<$>
ARGUMENTS h Remove a header string
t Remove a tail string
<$> String to remove
TASK To remove a string from the beginning or end of the filename.
FUNCTION This works exactly as the delete string function, except
that Case will only check the tail or end of the filename
(with extentions stripped) for matches (case insensitive).
This function is mostly implemented so that you can "undo" a
previous add head/tail call.
NOTE You can only remove one header, and only one tail per
session. It is not possible to remove tails or headers
from directories.
AFFECTS None
EXAMPLES Case -rh<LFO> "mod.<LFO>jungle" => "mod.jungle"
Case -rh<lfo> "mod.<LFO>jungle" => "mod.jungle"
Case -rh<lfo> "bla.<LFO>jungle" => [NO CHANGE]
(bla is not recognized as a prefix)
Case -rh<lfo> -E "bla.<LFO>jungle" => "bla.jungle"
(using the -E option, it is)
-v NAME Vomit files to PC-format
SYNTAX -v[<%>]
ARGUMENTS p Remove the prefixes
s Remove the suffixes
e Remove both prefixes and suffixes
- Only -v keeps the extentions.
TASK Truncate Amiga-filenames to PC-format, 8+3 letters.
FUNCTION If you write -vp, the prefixes will be removed, and the
(recognized) suffixes truncated to 3 letters. The
filename without extentions will be stripped so that
only letters and numbers remain, and then truncated
(if necessary) so that the length does not exceed 8
bytes. All characters are uppercased.
NOTE Beware (if you run this twice on the same file/s) of
truncated extentions, getting suddenly unknown, and
thus inevitably removed...
Beware also of the -k option's zealous work... If a
suffix is not known, then the -k will remove the dot.
A good idea might be to use the -E option...
AFFECTS re/k/u/f/c/w/l
rp (Remove prefix) Turned on if you specify -vp or -ve
rs (Remove suffix) Turned on if you specify -vs or -ve
m (Mutilate asci 128+) Turned on. Write -m AFTER the
-v[<%>] to turn it off again.
k Turned on with the task to remove _everything_ but
letters and numbers (so it differs a bit from the
normal -k option).
u (All Uppercase) -- Turned on
l (All lowercase) -- Turned off
c (Change cases) -- Turned off
w (Each new word uppercase) -- Turned off
f (First letter uppercase) -- Turned off
EXAMPLES Case -v mod.+1_psychedelic!.guide => MOD.1PSYCHED.GUI
Case -vs mod.+1_psychedelic!.guide => MOD.1PSYCHED
Case -vp mod.+1_psychedelic!.guide => 1PSYCHED.GUI
Case -ve mod.+1_psychedelic!.guide => 1PSYCHED
**********************************************************************
** THE REMAINING OPTIONS **
** (D, q, n, b, B, S, ALL) **
**********************************************************************
-D NAME Disable env:caseopts file
SYNTAX -D
ARGUMENTS None
TASK To ignore the file env:caseopts
FUNCTION The file env:caseopts will, if you specify this
(anywhere on the argument line), not be loaded. The -D
may also be present in the env:caseopts file itself,
which will then be ignored, even though it has been
loaded.
AFFECTS None
EXAMPLE Env:caseopts = "-l"
Case -Pmod "ARNESUNE" => "mod.arnesune"
Case -Pmod -D "ARNESUNE" => "mod.ARNESUNE"
-q NAME Be Quiet (only list errors)
SYNTAX -q
ARGUMENTS None
TASK To skip the rename listing.
FUNCTION The Case banner and result line will be displayed as
usual. Nothing else, unless an error occurs.
AFFECTS None
-n NAME Neglect the directories
SYNTAX -n
ARGUMENTS None
TASK To completely ignore all directories.
FUNCTION The filematching routine will be told to skip all
directories.
NOTE -n, -m and -S are currently the _only_ options that turn on
themselves by inverting the current value (by default
zero=NOP). This means that if you write -n -n it will be
turned on and then immediately disabled. This is only useful
if you have the -n written in the env:caseopts file,
and then temporarily want to rename some directories.
AFFECTS None
-b NAME Use a buffer when renaming (indirect)
SYNTAX -b
ARGUMENTS None
TASK To read in all the matching files before renaming.
FUNCTION This is on by default, because if it isn't, many operations
on the ram-disk will fail or even crash (due to a flaw in
the OS) and this would scare my users into abandoning Case,
thinking it is clustered with bugs ;)
If the memory for the buffers, holding all the filenames found
so far, should run out, use the -B option. You may want to use
the -B option anyway, so you won't have to experience that
annoying pause in the beginning, initiated when many files are
to be renamed... (See notes about the ram-disk for more info).
AFFECTS -B Turned off.
-B NAME Don't use a buffer when renaming (direct)
SYNTAX -B
ARGUMENTS None
TASK To rename one file at a time
FUNCTION This is off by default, because if it wasn't, many operations
on the ram-disk would fail or even crash (due to a flaw in
the OS). If you use this switch, you'll reduce memory
fragmentation and usage (though this only goes for big sessions,
lowercaseing a whole partiton for instance). Case will ask
AxeMatch for the next matching file, process it and call AxeMatch
again, until there are no more files. (See notes about the
ram-disk for more info).
AFFECTS -b Turned off.
-S NAME Simulate caseing, don't rename anything
SYNTAX -S
ARGUMENTS None
TASK To show the user what will happen before it happens.
FUNCTION Everything will go on as usual, except that no files will
be renamed. You'll see the results exactly as you'd see if
you had actually been renaming them. The only exception is
that all possible errors won't be caught. If Case would
strip the number from bla1.txt, renaming it to bla.txt, and
the next file was bla2.txt, it wouldn't be possible to rename
bla2.txt to bla.txt, since it already existed. When simulating
caseing this would not be noticed.
NOTE -S, -m and -n are currently the _only_ options that turn on
themselves by inverting the current value (by default
zero=NOP). This means that if you write -S -S it will be
turned on and then immediately disabled. This is only useful
if you have the -S written in the env:caseopts file, (as if
this was some kind of toy!) and then temporarily want to
actually rename some files...
AFFECTS None
ALL NAME Recurse into subdirectories,
SYNTAX ALL
ARGUMENTS None
TASK To recurse into all subdirs.
FUNCTION By default Case will only process the file or directory
that you specify after the options. If you wish to make
Case recurse into all subdirs (and their subdirs..),
write ALL after the options (and filepattern if any).
It might seem stupid to use -options all the time, except
for this, but I'm so used of using ALL that I made it this
way.
AFFECTS None
**********************************************************************
** Similar programs **
** (Short descriptions, where to get them, my impressions etc) **
**********************************************************************
To find out how well my program could compete with other programs I
took a look at Aminet and found a bunch of renaming utilities...
NAME FixName V1.20beta
AUTHOR Mikael Nordlund
RELEASED 930120
LOCATION util/cli/FixName120.lha
SIZE 6 KB
SHORT Capitalize first char on filenames in dir[...]
COMMENTS I hadn't seen this almost 5 year old program before. Very
impressive! Can recurse into subdirs, have the equivalent
of Case's -u -l -f and -w. And it even has the option to
open up a small GUI where you can do exactly the same as in
shell, plus save a configuration file. But it has no
pattern-matching, can only ucase/lcase a-z, plus I'd say
development has ceased :) Freeware.
NAME Arud Converter v2.2
AUTHOR Morten Amundsen
RELEASED 93xxxx - 9510xx
LOCATION util/misc/arud220.lha
SIZE 29 KB
SHORT Rename multiple files w/src (anims etc)
COMMENTS This program has a nice GUI for renumbering (and copying if
selected) large amount of files, all sharing the same
basename. The range can be selected and the basename
changed. Does not recurse into subdirs. Postcardware,
asm-source included.
NAME LookName 2.2
AUTHOR Philippe Muhlheim
RELEASED 940908 - 951023.
LOCATION util/cli/LookName22.lha
SIZE 10 KB
SHORT Make filenames lowercase or uppercase and[...]
COMMENTS This is what I wrote about Lookname in Case2.0's doc:
Since the last release I have seen some Case-like programs,
but only one is worth mentioning: LookName v2.2 by Philippe
Muhlheim. He released his first Case-clone a year before I
even got the idea. I give lots of thanks to Philippe for
inspiration and ideas (like the -v option). LookName works
on all OS, it seems, and has some options that this program
does not (like the possibility to flummy/deflummy filenames,
like "cool" = "τ°°1" and such). But it gives me the
impression of being a program to toy with, rather than to
aide, and it lacks a lot of useful things (v2.2) like the
remove string function, pattern matching, and the mandatory
ALL to recurse. Also it may CRASH when encountering the
ram-bug (see notes about the ram-disk), at least it did for
me the first time I tried it, not knowing my program
couldn't handle that either :) Lookname is Freeware.
NAME CExt V40.2
AUTHOR Chris De Maeyer
RELEASED 941016-970201
LOCATION util/cli/cext402.lha
SIZE 10 KB
SHORT Utility to change/delete/renumber filenames
COMMENTS This program can only handle 1024 files, but that makes
sense since it does not recurse. It can delete or rename
suffixes and renumber files. Basename and range can be set.
Freeware.
NAME ARen 1.4
AUTHOR Mendez Marc
RELEASED 941117
LOCATION util/sys/Aren14.lha
SIZE 12 KB
SHORT Extension of 'Rename', replaces patterns[...]
COMMENTS A small gui-less tool that seems to do the same thing as
Case's -C" option, except that it does not recurse. But it
lets the user specify if the replacing should be
case-sensitive or not. Does not recurse into subdirs.
Freeware, c-source included.
NAME MultiRename v1.0
AUTHOR Daniel S. Milling Jr.
RELEASED 941208
LOCATION util/misc/MRename1.lha
SIZE 34 KB
SHORT Rename/renumber lists of files.
COMMENTS Another renumbering program, with an impressive GUI (judging
from the size of the program and the doc). The range and
basename can be set. I haven't seen it though, since it
crashes on my 060. Shareware.
NAME AutoRename V1.0
AUTHOR Francesco Gambino
RELEASED 950111
LOCATION util/sys/AutoRen_v10.lha
SIZE 18 KB
SHORT AutoRename is a utility to rename a lot[...]
COMMENTS This program is buggy, and in italian. Judging from the 4
short examples in the doc, it adds an incremented number
together with an optional headerstring to all the files that
match. I believe I have some modules by this guy... they
are a lot better than his program ;) Freeware, I think.
NAME RenumSeq.rexx 1.0
AUTHOR Christoph Mayer
RELEASED 950114
LOCATION gfx/edit/RenumSeq.lha
SIZE 1 KB
SHORT This ARexx-script renumbers or renames[...]
COMMENTS ARexx script to renumber filenames. Very primitive, but I
guess it does its job. Freeware.
NAME No Pain Rename 1.0
AUTHOR Travis Riggs
RELEASED 9507xx
LOCATION util/sys/nopainrename.lha
SIZE 140 KB
SHORT Batch filename renaming utility
COMMENTS A simple (yet huge) renumbering program, with an awful GUI.
Basename and range can be set. Shareware.
NAME UnderScore 1.0
AUTHOR Braneloc
RELEASED 9508xx (Recompiled 970619)
LOCATION util/cli/underscore.lha
SIZE 23 KB
SHORT Removes spaces from filenames
COMMENTS Hmm... of all the programs I've tried, this is by far the
most pathetic! It's 35 kb, and all it does (no options, not
even filepattern!) is the same thing as writing Case -t ALL.
It does recurse. In fact, it always recurses!! Maybe you
think I'm a bit harsh on the programmer, but... Get this...
he wants you to pay him ú10 for it!!! The underscore.doc is
not a doc but a registration form!! I'm apalled...
NAME UpperName 1.0
AUTHOR Franck Aniere
RELEASED 950822
LOCATION util/batch/UpperName.lha
SIZE 6 KB
SHORT Upper case filenames
COMMENTS This is the most primitive of the Case-clones I've seen. It
can only uppercase one file at a time... Freeware.
NAME LowUp 1.0
AUTHOR Franck Aniere
RELEASED 95082x
LOCATION util/cli/LowUp_Upd.lha
SIZE 10 KB
SHORT Upper/Lower case filenames
COMMENTS This an update of the most primitive of the Case-clones I've
seen. Apparently, after the author had found out some
people did not like uppercase only filenames, he changed the
name from Uppername to LowUp. It can now both uppercase and
lowercase _one_ filename at a time. He has included a GUI
version as well though (written by one of the program's fans
(!)) which uses the reqtools library and is quite nice; but
it is still as limited. All freeware.
NAME Npmv 1.0
AUTHOR Stefan Le Breton
RELEASED 960122
LOCATION util/sys/npmv.lha
SIZE 2 KB
SHORT Rename without(!) pattern matching
COMMENTS All this program does is to rename files whose names
contains characters used by the dos pattern matching.
Freeware.
Phew... so far I've found no program that I've been forced to admit is
better than Case. Now only one remain to test... The filesize worries
me, hmm.. 341 kb!? Aha... no need to worry :) Because, it is...
NAME No Pain Rename 2.0
AUTHOR Travis Riggs
RELEASED 1996
LOCATION gfx/misc/rename2u.lha
SIZE 174 KB
SHORT Rename multiple files with ease!
COMMENTS Well, the GUI has improved, A LOT. And there are many new
features, but it is still only intended for renumbering
purposes. However, if you want all the new features you
must pay $10 to the author, as No Pain Rename is still
shareware. I really hate it when people release their
programs as shareware, especially cut-down versions. But
that's just me...
NAME Ename v2.0
AUTHOR Rafaε Mantiuk
RELEASED 960618
LOCATION util/cli/EName20.lha
SIZE 8 KB
SHORT Rename many files.
COMMENTS This cli-command is quite powerful when it comes to
substituting or removing strings from filenames. It can
also lowercase or uppercase. I didn't find it too easy to
understand though, and it do also have a simulation option,
so as to give the user a chance to see what will happen if
he starts the program... (Actually, after seeing this in
another program as well, I implemented it in this version of
Case!) One thing that impressed me was that it won't be
confused if one file will be given the same name as another
file (but which won't have this name after the operations
has been performed). Does not recurse into subdirs.
Postcard/emailware.
NAME MRename 1.3
AUTHOR Martin Steigerwald
RELEASED 960714-960921
LOCATION util/cli/mrename.lha
SIZE 7 KB
SHORT Renames files in a flexible way (1.3)
COMMENTS This is a nice program that is quite like Case. It can
recurse into subdirs, uppercase, lowercase, uppercase first
letter in every word and change extentions to a specified
name. It also lets you specify if you want only dirs or
only files to be renamed, and there's also a testmode. But
don't try this program on the ram-disk... luckily I could
CTRL-C it out of its endless loop... (See notes about the
ram-disk.) Freeware.
NAME RenameIt 1.0
AUTHOR Dante/Oxyron Software
RELEASED 960731
LOCATION util/sys/RenameIt.lha
SIZE 27 KB
SHORT Multiple file rename Tool
COMMENTS This is a quite primitive program for manipulating
filenames. It seems to target extentions only, at least
that's what I could gather after skimming through the 3kb
doc... It has a GUI though. I don't think that's
appropriate for a program like this, but I guess some people
would prefer it.
NAME KRenamer 1.1
AUTHOR Kordi/Blabla
RELEASED 970420
LOCATION util/cli/2b_KRenamer11.lha
SIZE 9 KB
SHORT Changes name of all files in directory..
COMMENTS Quite nice gui-less program it seems, which lets one rename
all (or parts of) the files in a directory into the same
name, only separated by numbers. That's currently all it
does though, even if the doc promises more in future
releases. Does not recurse into subdirs. Freeware.
NAME MRenfix.rexx 1.0a
AUTHOR Anders Nordby
RELEASED 1996
LOCATION util/sys/mrenfix.lzh
SIZE 2 KB
SHORT Changes pre-/suffixes in filenames
COMMENTS A rexx script to remove/add/change suffixes and/or prefixes.
Does pattermatching and recurses into subdirs. Requesters
pop up if you forget some parameters. And you'll be
prompted for the extentions to add/remove. But when the
process finally starts, there's no indication as to what's
going on...
To sum up... Even Case 1.0 could do more than any of these programs
(possibly with the exception of LookName). But there seems to be a high
demand for renumbering programs. I have never found use for this myself, but
I'll probably include this in the next release.
**********************************************************************
** -+- THE END -+- **
** (Notes about the ram-disk, contact me, history etc...) **
**********************************************************************
NOTES ABOUT THE RAM-DISK
Some 1.5 year ago, Axehandle reported a bug. Using this and that
option on these and those files would bring Case into an endless
loop of renamings. I thought he had a lot of nerve blaming me
for this, when it obviously was his filematching routine that
was flawed! I tried to reproduce the bug, but it worked on my
machine. He persisted -- "your program is buggy!" -- and we
almost got into an argument...
I looked deeper into this, and found that I COULD reproduce the
bug, but only when I used Case on the ram-disk. Some debugging
revealed that his filematching routines would pass me the same
file over and over again... Aha! With a malicious, triumphant
smile, I called Axehandle... "Like I suspected, it IS your bug!!"
But he wouldn't have it that way. "If it isn't your fault, then
it must be a bug in the OS." he concluded calmly. "Yeah right!!"
But... he was right. I don't remember exactly under what
circumstances it happens, but I think that when a file change
name, the OS will notice "oh, there's a file I didn't see
before! better pass it.." and so I get it again. Rename it
again, and the OS... "Oh a sandwich! I like sandwiches..."
I noticed the same thing a few days ago, when I was, hmm,
watching some pictures on the ram-disk, with viewtek #?.
When I deleted a picture that I had just viewed, it would
start over from the beginning, showing all the pictures that
I had already seen.
Anyway, no need to worry about this in Case! With a lot of pain
I added the default option to read in all matching files in a
buffer, and then rename them. More about this in the text about
the -b and -B options.
BUGS???
Very likely. I don't know of any at the moment though.
HISTORY
v1.0 (950809)
** The first release.
v2.0 (960320)
** Real filematching implemented, thanks to Axehandle. It
uses some 2.04 functions, so Case now only works with OS 2.04++
** Lots of changes, too many to write down. No one used
the first version anyway...
v2.1 (971221)
** Well... I *still* haven't got any indication that I have one
single user, after more than two years since the first release!
Yet I code on...
** Renamed almost all options, in a vain attempt to be more
consequent, and make the names easier to remember:
-i[s|p] was renamed to -I[e|s|p] (Don't ignore extentions when caseing)
-I[S|P] was renamed to -i[e|s|p] (Ignore extentions when caseing)
-EU was renamed to -u(e|s|p) (Make Extention/Suffix/Prefix uppercase)
-EL was renamed to -l(e|s|p) (Make Extention/Suffix/Prefix lowercase)
-S<$> was renamed to -as<$> (Add specified suffix)
-P<$> was renamed to -ap<$> (Add specified prefix)
-s[<$>] was renamed to -rs[<$>] (Remove [specified] suffix)
-p[<$>] was renamed to -rp[<$>] (Remove [specified] prefix)
-r<c>.. was renamed to -d<c>.. (Delete specified char[s])
-R<$>,.. was renamed to -D<$>,.. (Delete specified string[s])
-e[s|p] was renamed to -s[e|s|p] (Swap extentions [or only Suffixes/Prefixes])
-c[p|s]<#> was renamed to -L[e|s|p]<#> (Set Extention/Suffix/Prefix maxlength)
-o was renamed to -E (Don't use default Extentions)
-O was renamed to -e (Accept default Extentions only)
-o<$>,.. was renamed to -E<$>,.. (Only accept specified Extentions)
-O<$>,.. was renamed to -e<$>,.. (Only accept default Extentions & specified)
** Prefix options that default to operating on extentions, but
that can be made to operate on only prefixes/suffixes, now accept
e (for both) as well as the usual p (prefixes only) and s
(suffixes only)
** All specified extentions are now added to the list of
recognized extentions. So if you want to remove the suffix .bla,
you only need to write -rsbla, and don't worry about whether bla
is a recognized suffix or not.
** Any given extention will adjust the extention maxlenght, if
(and only if) it is exceeded.
** If a filepattern contains spaces, it now must have single or
double quotes surrounding it.
** The delete chars functions are no longer case-sensitive. If you
want to remove all ÷:s, -d÷ will remove ÷:s as well as ╓:s.
** It is now possible to specify characters to delete on several
places, without having the previous chars forgotten.
** If an extention operation is selected, but no extention was
modified, or even found, Case will now display a little reminder
that maybe this was because you wanted to process files with
alien extentions, and maybe you should try the -e option etc. This
is so you won't think Case is flawed, like even I myself has
thought several times! So easy to forget...
** Made an indirect mode to read all the filenames into a
buffer, and then rename from that. Added the options -b and -B
to select between direct and indirect mode.
** Added -ae, add specified extention.
** Added -r(h|t)<$>, remove head or tail string
** Added -C"<$>",<$> -- change string one to string two.
** Added -C<%>[<$>,]<$>, change extentions [from this] to that.
** Added -S, simulate caseing.
** Added a new caseing operation, -c, change all cases.
** Added -m, mutilate ASCII 128-255 into 45-127
** The -v (vomit) option now turns on -m, and it will no longer
remove the prefixes by default. You'll have to write -vp if you
want those removed as well.
** The caseing operations (-l, -u, -c, -w, -f) will now operate
on extentions only, if they are followed by p, s or e.
** A few minor bugs corrected
** More extentions are recognized...
qt, gz, pi
c++, cpp, arj, obj, env, mov, avi, jpg, tex, p61
tar, htm, man, mpg, mp3, bz2, tgz, lzh
jpeg, gzip, html
amiga, prefs
symmod
v2.2 (980127)
** Two happy Case users revealed themselves. Thanks Trevor & mr Bouwhuis!
** Above mentioned new extentions were actually only added to the doc.
I forgot to add them in the source. Apart from all those new
extentions, there's three more: xm, s3m and rexx.
** Corrected flaw in the argument parsing. Case wouldn't report a
syntax error when several source-names were entered. (This is not
yet allowed)
** When in recursive mode, if a directory-name got renamed by Case,
(so the characters actually changed, not only the cases) any
files in that directory would not be found. Solved this by
letting the pattern matching routine pass Case the directory names
when they were leaved, instead of when they were entered.
** Whenever a file in the search path could not be locked for some
reason, case would abort the whole operation with "can't find file
or path!" If in the default buffered mode, no files would ever be
renamed. Now, whenever the filematching routine cannot lock a file,
Case will look at the name to determine if the user wanted that
file to be renamed. (If, for instance, the user wanted to uppercase
all filenames, and this file already was uppercased, there would be
nothing to worry about.) If he didn't the file will simply be skipped.
If he did, the fail counter will be incremented and the message "can't
lock xxx because object is in use" will be displayed.
** The -C" option (change string 1 to string 2) was flawed.
case21 -C"bl",bl bla would result in renaming bla to bla. Also:
case21 -C"bl",bla bla would not rename bla to blaa, since Case thought
this had already been done.
THE PHUTURE
Many rats has left the ship... happily eating Bill Gates' cheese,
the cheese they once loved to curse. Well, like I use to think on the
last night of the Roskilde festival, as a large amounts of people
head home (even though there's one festival night left!):
-- Only the cool people stay...
I will stay, and continue releasing updates on this program. I have
a few ideas in mind... The most important one is to implement an undo
function. If Case should chance to really fuck up my files, I'd like
to write Case UNDO, to restore the names. Also all known extentions
should perhaps be flagged as prefix only, suffix only or any of the two.
DISCLAIMER
If you are interested in the disclaimer or crap like that, then contact me.
CONTACT ME...
If you want an update made, have bug-reports, suggestions, anything..
EMail: parsec@aljan.com.au
This address is at least valid to the end of mars 1998.
After that, use: blodskam@hotmail.com
I have, btw, used the handle Parsec since the summer of 1991. I know
many people think handles are silly (albeit /nicks are "kewl"), but...
It's a silly life! Take it seriousley, and *you* are the fool!
SPECIAL THANKS...
* My "menthor" Thomas Richter, for helping me whenever I despair...
* Aaron Scott, for a lot of things...
* Phil @ AmigaGenius for giving birth to my hd-farm.