Bulk rename remove spaces from folder/file names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zergor
    New User
    • May 2016
    • 1

    Bulk rename remove spaces from folder/file names

    First post here, long time user. I know that I've done this before but its been a few versions and I'm not able to find the regex to correctly do this.

    I would like to remove spaces from my folder names.
    So something like :
    My Project that I named really long
    Ends up as:
    MyProjectthatInamedreallylong

    Semi related, replace . with -.
    Thank you very much!
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    Beyond Compare 4's Rename does not support searching an arbitrary number of times for the Old Mask line, so either you need a RegEx that matches the correct number of spaces, or you run the RegEx multiple times.

    The simple example would be the literal replacement of " " => "" without quotes. Each time it is run, it will remove one space from the selected file names.

    You could also create a more complex RegEx to remove more than one at once:
    ([^ ]+) +([^ ]+) +([^ ]+)
    $1$2$3
    which would remove 2 whitespaces at a time, but would not remove a single whitespace if only one was left.
    Aaron P Scooter Software

    Comment

    Working...