need help renaming for soundcloud

A swapping-ground for Regular Expression syntax

need help renaming for soundcloud

Postby welp » Mon Oct 30, 2017 5:33 pm

So basically after downloading from soundcloud I get a list of .mp3 files with format usually like:

Image

songname_number9digits - artist.mp3

Format observations:
1. "songname" some times have other symbols, spaces, etc.
2. "number9digits" the number is randomized is is usually 9 digits
3. "songname" and "number9digits" are seperated by "_" with no spaces in between
4. "number9digits" and "artist" are seperated with " - " (space dash space)

Format I really want:

artist - songname.mp3

I just couldn't get the expression to match and replace for the life of me.

Thanks for the help!
welp
 
Posts: 3
Joined: Mon Oct 30, 2017 5:22 pm

Re: need help renaming for soundcloud

Postby therube » Mon Oct 30, 2017 6:28 pm

1.RegEx
Code: Select all
Match:  (.*)_\d{9} - (.*)
Replace:  \2 - \1
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: need help renaming for soundcloud

Postby welp » Sun Nov 05, 2017 3:14 pm

much thanks and love <3
welp
 
Posts: 3
Joined: Mon Oct 30, 2017 5:22 pm

Re: need help renaming for soundcloud

Postby Panchdara » Sun Nov 12, 2017 11:56 am

@therube:

would
Match: (.*)_(.*) - (.*)
Replace: \3 - \1

have worked too? (assuming the original format remains constant as described)
Panchdara
 
Posts: 67
Joined: Sat Jan 09, 2016 7:25 pm

Re: need help renaming for soundcloud

Postby welp » Fri Jun 04, 2021 12:28 am

Panchdara wrote:@therube:

would
Match: (.*)_(.*) - (.*)
Replace: \3 - \1

have worked too? (assuming the original format remains constant as described)



Thank you @Panchdara. Your method actually works better because sometimes the numbers vary in length. I appreciate your input.
welp
 
Posts: 3
Joined: Mon Oct 30, 2017 5:22 pm


Return to Regular Expressions


cron