N00b: Underscore Clearing Script.

Come up with a useful post-processing script? Share it here!
Post Reply
ChrisiB
Newbie
Newbie
Posts: 2
Joined: June 14th, 2010, 12:53 pm

N00b: Underscore Clearing Script.

Post by ChrisiB »

Hi,

I've looked at the wiki and searched the manual but I can't seem to find a way of removing the _ in filenames.

I want e.g. "I_Love_This_Film_(2009)[1]" to be replaced with "I Love This Film (2009)"

Any ideas would be helpful, thank you
doubledrat
Release Testers
Release Testers
Posts: 180
Joined: February 20th, 2008, 3:16 pm

Re: N00b: Underscore Clearing Script.

Post by doubledrat »

pc or linux?  what exactly do you want the _ removed from?  filenames?  directories?
ChrisiB
Newbie
Newbie
Posts: 2
Joined: June 14th, 2010, 12:53 pm

Re: N00b: Underscore Clearing Script.

Post by ChrisiB »

This will be for PC using Win 7.

I have just come from ALTbinz and it used to replace all the underscores, I prefer the collection with spaces as it looks neater.

I notice I wrote filenames in the previous, but what i meant was the folder name, i.e. the name of the NZB therefore my example was the name of the folder before and after sorry.

thanks
doubledrat
Release Testers
Release Testers
Posts: 180
Joined: February 20th, 2008, 3:16 pm

Re: N00b: Underscore Clearing Script.

Post by doubledrat »

well.  If you have a single level directory structure and the name of the directory is the same as the name of the nzb you can do this

Code: Select all

REM root will be different for you
set root=C:\mydownloads\linux
REM paramater 3 is the nzb name
set name=%3
REM remove quotes from the name
set name=%name:"=%
REM replace _ with space
set newname=%name:_= %
REM rename the directory
rename "%root%\%dirname%" "%newname%"
I've not tested this, so forgive any errors!
Post Reply