#1 2008-11-16 08:46

satow
Member
Registered: 2008-11-16
Posts: 3

Put a dash between lowercase and uppercase letters

Hi everyone!  I'm using renamer and so far, I really love this program!  However I ran into a problem that I cannot solve.  I have about 100 files where the spacing has changed.

For example (s):

Foo FightersMy Hero.mp3
Lenny KravitzFly Away.mp3
LiveI Alone.mp3

I want to put a space between the "s" and the "M", a space between "z" and "F", and "e" and "I".

In other words, I want to put a " - " between the lowercase letter and the uppercase letter. 

Is there a way to do this in Renamer?

Thanks!

Offline

#2 2008-11-16 08:53

satow
Member
Registered: 2008-11-16
Posts: 3

Re: Put a dash between lowercase and uppercase letters

Hi Everyone!  I figured out the problem from another post regarding putting a space between a lowercase and an uppercase character.  What I did was put the following code using "add rule", then "PascalScript", then after cutting and pasting it in, clicked on "Try to Compile" and it worked so I added it as a rule, ran the job by clicking the "rename!" button, and voila!  it worked! big_smile


const
  Separator = ' - ';
var
  I: Integer;
begin
  for I:=WideLength(FileName) downto 2 do
    if IsWideCharAlpha(FileName[i]) then
      if IsWideCharUpper(FileName[i]) and
         IsWideCharLower(FileName[I-1])
      then WideInsert(Separator, FileName, I);
end.

Offline

#3 2008-11-16 14:26

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Put a dash between lowercase and uppercase letters

Other way is with RegEx

Expression: ([a-z])([A-Z])
Replace:     $1 - $2
Case sensitive checked


If this software has helped you, consider getting your pro version. :)

Offline

Board footer

Powered by FluxBB