Page 1 of 1

Delete the prefix and hyphen from multiple files?

PostPosted: Fri Jul 30, 2021 8:00 pm
by letterman
Hello,

I have a lot of files in the format of three letters, four numbers and a hyphen, for example:

LYJ1598 - filename
LYJ1599 - filename
LYJ1600 - filename
LYJ1601 - filename
LYJ1602 - filename

etc

As you can see, each of the prefixes are different. Is there a way in which I can batch rename all the files, for example:

"LYJ1601 - filename" to just "filename"

Thanks!

Re: Delete the prefix and hyphen from multiple files?

PostPosted: Fri Jul 30, 2021 8:06 pm
by therube
1:RegEx, enable Simple
Code: Select all
Match:  %1 - %2
Replace:  %2

That should remove everything up through & including the first instance of " - ".

Re: Delete the prefix and hyphen from multiple files?

PostPosted: Fri Jul 30, 2021 8:21 pm
by letterman
therube wrote:1:RegEx, enable Simple
Code: Select all
Match:  %1 - %2
Replace:  %2

That should remove everything up through & including the first instance of " - ".


Thank you for your quick reply! I am new to the software so am just getting to grips with it.
I have just noticed that some of the files have another " - " in them for example:

"LYJ1601 - filename - morefilename"

Would your instructions still work? I just want to be sure before trying it out. Thank you

Re: Delete the prefix and hyphen from multiple files?

PostPosted: Fri Jul 30, 2021 8:27 pm
by letterman
I just realized I can use the 'Remove function' to get rid of the first few letters and numbers so I think this can work too.

Re: Delete the prefix and hyphen from multiple files?

PostPosted: Fri Mar 11, 2022 12:57 pm
by GayeNT
therube wrote:1:RegEx, enable Simple
Code: Select all
Match:  %1 - %2
Replace:  %2

That should remove everything up through & including the first instance of " - ".


THANK YOU SO MUCH FOR THIS - I have just spent 5 hours highlighting and removing the words up to and including the hyphen in my music folders and then I thought surely there has to be a simpler way.
Note to self ask Online Forum FIRST
thank you :shock: :D