Case 1.0 - Filename Changer - Copyright © 1995 by Erik Spåre ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A good night. A good night for nothing, indeed. Tonight nothing will happen, here I can walk alone, no one will disturb me. Here I can walk in peace and await my own dear death. Here I can stand 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) ********* 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 hasn'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 could 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 *revolting* In this case (hmm) I used the following options to produce the right list: Case -l -t -k -Pmod modules:old/ -l to make all chars lowercase, -t to transform the spaces to underlines, -k to keep only the letters & numbers (thus removing '(' and '!') and -Pmod 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 are probably one or more options which may be more suitable to your taste... ********* List of all the options ********* First the four main commands: -l Make all letters = lowercase -u Make all letters = uppercase -w First in each word = uppercase -f First in filename = uppercase Then there are 5 options to remove unwanted characters: -t Transform spaces to underline. (_) EXAMPLE: "ah ha" = "ah_ha" -k This option will keep only letters, numbers, underlines, spaces and all the characters you specify directly after the -k. EXAMPLE: 'Case -k' would rename the file "Bla-ha hum_(5)" to "Blaha hum_5", when 'Case -k()' would keep the paranthesis : "Blaha hum_(5)" -K Like -k, but all letters apart from A-Z (for instance Ë) will be removed from the filenames. -r Removes all spaces. EXAMPLE: "ah ha" = "ahha" -R Removes the chars you specify directly after the -R. EXAMPLE: 'Case -R!$' would remove all the ! and $ from the filenames. The following 7 options deal with the prefixes and suffixes in various ways: -S Add a suffix to the filename. EXAMPLE: 'Case -Stxt'. Now each file (the directories are not affected) will be checked for the suffix. The check is NOT case-sensitive. However, if a file is called file.TXT it will be renamed to file.txt (and NOT file.TXT.txt). If the suffix is not found in the filename, it is added. -P Add a prefix to the filename. Like the S command, but... -s Remove a (specified) suffix. If a suffix is specified only that suffix will be removed. Again the check is NOT case-sensitive. If no suffix is specified all found suffixes (with a default maximum of 3 chars) are excluded from the filenames. -p Remove a (specified) prefix. Like the above command, but... -c Change suffix and/or prefix maxlength. Valid arguments to this switch is s# (change suffix maxlen), p# (change prefix maxlen) and # (change both suffix and prefix maxlength). # is a number between 1 and 9. When a suffix/prefix is checked, it is assumed to be no longer than 3 characters. (If it is more the risk of the prefixes/suffixes getting mixed up is rapidly increased. Take "bla.file" for instance, what is the suffix? Is there a suffix?). This option changes the maxlength... If you are adding the suffix .text then use this option like this: 'Case -cs4 -Stext', if you leave out the -cs4 this will happen: hmm.text -> hmm.text.text ! Note that the suffixes has priority over the prefixes (that is currently not possible to change), so the file mod.txt will be stripped like this: prefix = (none), name = mod, suffix = txt. -i Ignore suffixes and/or prefixes. Like the -c option you can use this alone, or add a p (-ip) or s (-is). This option is used to treat the suffixes and prefixes as nothing but a part of the filename. EXAMPLE: 'Case -w' will change the file MOD.INTERMODO.PP to MOD.Intermodo.PP, because by default it leaves the prefixes and suffixes alone. 'Case -i -w' makes it Mod.Intermodo.Pp, 'Case -is -w' ignores only the suffix thus resulting in Mod.Intermodo.PP. The -i switch is used by default by the -l and -u commands. -I Do not ignore suffixes and/or prefixes. The oposit to the -i switch. The prefix and suffix is stripped from the filename before the other operations begin. This is default for the -w and -f commands. -a Finally there is the -a option, that is comparable to the common ALL/S and alikes. I was just to lazy to check for 3 characters at the end... Use this when you want ALL files in a directory (and its subdirs) to be affected. ********* More useful information about Case ********* The options you specify must all start with the minus sign. If there is an argument given after the command there must be no spaces between them. Everything that is written after the last -option is assumed to be a directory name, meaning this is okay: Case -l -r the text dir. But this isn't: Case -l -r "the text dir". Yes, again I have been lazy! Recognized as lowercase letters (thus possible to make uppercase): abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüý Recognized as uppercase letters (and possible to make lowercase): ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ And just recognized as a letter (not possible to lowercase) is ß Case is 100 % assembler It should work on all amigas and all OS, but I'm not sure... ********* Final words... ********* This is freeware... etc Contact me for anything at: Erik Spåre Lundbladsv 35 A 633 49 Eskilstuna SWEDEN (Parsec / Phuture 303) Version 1.0 released 950809 ************** * * * Hey Ho!! * * * ************** LFO here =).Well Parsec asked me to check the English on this doc before the release...So i just couldn't help but to add this so called `Secret Part' Well all i have to say really is that i am now back to the Scene!! So today i have for you my new permanent address...here it is!! LFO/PHUTURE 303 WHQ 135 STOURTON AVE HANWORTH MIDDX TW13 6LD ENGLAND So grab a pen and write to me for any reason whether it be for Swapping, Friendship,or even Joining Phuture 303.All senders of disks will get them back full of kewl stuff and our latest releases....Until then see you on a screen somewhere in the Phuture..