NSFileRenamerConsole

The application is a command line tool that allows you to rename files based on custom needs.

There are lots of files containing more characters than needed in the file name, usually mp3 files. These files are something like Band Name – Album Name – Year – Real Song Name1.mp3 end so on. If you want to have these files named as just Real Song Name1.mp3 than you can use this program.

Basically you can choose to replace a given word with another word (or no word at all like in above example)

Also you can choose to keep only a fixed number of characters in the file name.

Another utility is when you have the parent folder name also part of the file name and you want to remove that. Also, you can have the oposit of the above operation, add the folder name in the file name.

Is recommended to put the executable in path (c:\windows for example) and run the command line from the folder you want to rename its files. Also you can use alternative way to give the folder using startpath= argument.


The command arguments are:

1. pattern : specifies the pattern for the files to be replaced. You can choose to remove the first 10 characters only for files continaing word testdatabase for example.

2.oldname / newname:  oldname: specifies the word to be replaced,  newname: specifies the word to be replaced with (it can be empty, this will lead to removing the oldname word from the filenames)

3.charlen: specifies the number of characters to be removed/kept . The extension is included when calculating the lengths

4. action: specifies the remove type when removing a fixed number of characters. Possibile values are:

  • keepfirst (keep first x characters, x specified with charlen switch)
  • keeplast (keep last x characters)
  • removefirst (removes first x characters)
  • removelast (removes last x characters)

5. (optional) startpath: the full path of the folder you want its files renamed.

6.(optional) recursive: use recursive=true if you want to use the same replacement rules for all folders , recursive

7.(optional) copy=true this switch will not rename the file but create a copy instead.

8.removebefore / removeafter: all the characters from the file name before or after the specified word will be removed. Example: if the file name is “Pink Floyd – Wall.mp3” using removebefore=” – ” the output will be Wall.mp3. The keyword will also be removed (default behaviour). If you want to keep the keyword then use also the option removeword=”False”

 

Also, if you want more flexiblity you can use $dirname$ for the parent directory name and $filename$ for the filename without extension and $filename.extension$ for file name including extension.

These last features allows you to change a file like: database file 1.bak to 2012-01-01 database file 1.bak using these arguments: oldname=$filename$ newname=”2012-01-01 $filename$”

 

Examples:

1. Change files like Track 01.mp3 into Song 01.mp3:

pattern=*.mp3 oldname=Track newname=Song

2.Change files like 01 My Song Name.mp3 and 02 My Other song name.mp3 into My Song Name.mp3 (removing the ordinal position from the beginning):

charlen=2 action=removefirst

3. Add/Remove the parent folder name to/from the file name

    • Add folder name: pattern= *.* oldname=$filename$ newname=”$dirname$ – $filename$”

 

  • Remove folder name:  pattern=*.* oldname=”$dirname$”  newname=”” recursive=true

4. Change File Name Extension: (changes all the file extesions into dat extension).

pattern=*.* oldname=$filename.extension$ newname=$filename$.dat

 

Download link: NSFileRenamerConsole

 

Comments are closed.