Remove text from beginning

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Remove text from beginning Wed Jul 22, 2015 3:06 pm • by logo
Hi,

Can Hazel, or a script that Hazel can run, remove the numbers from the beginning of a file and the space in front of a file?

i.e.
'01 Name of song" to "Name of song"

I have usb drives for my music I play in my car and want to remove the unnecessary text from the beginning. Since these are copied from my Music folder to the USB drive, the originals aren't changed.

Thanks,
Cindy
logo
 
Posts: 12
Joined: Tue Feb 15, 2011 12:11 pm

Re: Remove text from beginning Wed Jul 22, 2015 4:22 pm • by Mr_Noodle
Look up "match patterns" in the help. What you want to do is have a custom token grab everything after the initial number, then use that custom attribute in the rename action. Give that a shot and report back if you still have problems with it.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Remove text from beginning Thu Jul 23, 2015 9:38 am • by logo
Awesome! Thanks for the help.

I love Hazel. :D
logo
 
Posts: 12
Joined: Tue Feb 15, 2011 12:11 pm


Return to Open Discussion