Script for changing filetyp from .nfo to .whatever

Come up with a useful post-processing script? Share it here!
Post Reply
Chillout
Newbie
Newbie
Posts: 5
Joined: April 18th, 2013, 11:22 am

Script for changing filetyp from .nfo to .whatever

Post by Chillout »

Heyho.

I need a Script for sabnzbd which changes the filetyp (only renames) from .nfo to .whatever, because i'm scraping all movie informations which will be saved in a .nfo-file.

All in all i'm not a coder, just a user and designer.

My first idea was something like this

Code: Select all

mv *.nfo old_filename.whatever
But as already said, i don't know how exactly :)

Would be great if someone just posts an simple script.

Cheers,
Chillout
User avatar
sander
Release Testers
Release Testers
Posts: 8886
Joined: January 22nd, 2008, 2:22 pm

Re: Script for changing filetyp from .nfo to .whatever

Post by sander »

How about:

Code: Select all

rename 's/\.nfo$/.whatever/' *

Works for me:


Code: Select all

sander@toverdoos:~/kul$ touch adfaadsf.nfo
sander@toverdoos:~/kul$ touch adfff.nfo
sander@toverdoos:~/kul$ touch djdjdj.nfo
sander@toverdoos:~/kul$ ll *nfo
-rw-rw-r-- 1 sander sander 0 2013-04-19 06:36 adfaadsf.nfo
-rw-rw-r-- 1 sander sander 0 2013-04-19 06:36 adfff.nfo
-rw-rw-r-- 1 sander sander 0 2013-04-19 06:36 djdjdj.nfo
sander@toverdoos:~/kul$
sander@toverdoos:~/kul$ rename 's/\.nfo$/.whatever/' *
sander@toverdoos:~/kul$
sander@toverdoos:~/kul$ ll *whatever
-rw-rw-r-- 1 sander sander 0 2013-04-19 06:36 adfaadsf.whatever
-rw-rw-r-- 1 sander sander 0 2013-04-19 06:36 adfff.whatever
-rw-rw-r-- 1 sander sander 0 2013-04-19 06:36 djdjdj.whatever
sander@toverdoos:~/kul$
Assuming Linux / Unix / OSX
Post Reply