i would like to trim file names in batch for eg: From “This IsGood 1.1.png” To “tig11.png”
The condition is that the script should get all capitalized letter from the file name,convert them into small letters and then form the trimmed file name without any spaces in it…
Please me help accomplishing this task..
Thanks!
you may begin with a simple iteration on the filename
read
HELP SET,HELP IFandHELP GOTONow, if understood, proceed by changing the
echocommand into a call…read
HELP CALLthen implement the actual code for checking if the character is uppercase or not
read
HELP FORchange now this new
echocommand into a new call to a function to set the variable to lowercasenow concatenate the result into a, say,
fnvariable that you will need to initialize to blanks.and wrap all with the appropiate filename handling, extracting just the filename (see the ~n option in the syntax of handling parameters) and then composing back the full path with the new name (using the ~d ~p ~x options)
use this as a starting point. you will have to add your own logic for renaming the file and handling if the file already exists or if the file cannot be renamed …