This powerful plugin allows you to rename files using pre-defined new names. The plugin works with 3 types of lists (3 modes).
Mode 1 - TWO-LINES (default). In this mode old and new file names are stored in one file. Each odd line represents the name of an existing file and the following even line contains its new name. Example:
c:\docs\file1.txt
c:\docs\new-name-for-file1.txt
c:\docs\file2.txt
c:\docs\new-name-for-file2.txt
Mode 2. SEPARATOR. This mode is used when both old and new names are given in one file and in one and the same line, but they separated with a known symbol or set of symbols, for example:
c:\docs\file1.txt<=>c:\docs\new-name-for-file1.txt
c:\docs\file2.txt<=>c:\docs\new-name-for-file2.txt
Mode 3. SIMPLE-LIST. This is the most simple mode, when old names are given in one file, and new names are given in another file in the corresponding lines.
Installation:
This distributive archive has the same folder structure as the main SR folder.
So just copy all the files to the corresponding folders, for example, "external\lists.dll"
to "c:\program files\sophisticated rename\external\lists.dll".
General information:
Func name: processlist
Result key: result
Parameters that are the same for all three modes:
BRUTALMODE. It can be either 1 or 0. When it is 1, the plugin will return "*** ERROR: No Match! ***" line if there is no match in the filelist for current file. In this case you will not be able to rename other files. If you set this parameter to 0, the absent matches will be replaced by the old file names and you will be able to rename other files. This parameter is optional, when it is not specified, default value 0 will be used.
PATHMODE. Can be 00, 01, 10, 11. If the value is not set, then 11 will be used. There are also short variations: 0 means 01 and 1 means 11. The first digit describes how you would like to search matches and the second digit describes the situation with output paths. If your filelist contains full paths, you must use 10 or 11 to use paths in the search. If your filelist has only file names, you must use 00 or 01 to search without paths and the "Custom Paths" feature in the SR "File List" menu must be turned off:
Filelist:
file1.txt<=>new-name-for-file1.txt
file2.txt<=>new-name-for-file2.txt
Result:
c:\docs\file1.txt -> c:\docs\new-name-for-file1.txt
c:\docs\file2.txt -> c:\docs\new-name-for-file2.txt
c:\private\file1.txt -> c:\private\new-name-for-file1.txt
c:\private\file2.txt -> c:\private\new-name-for-file2.txt
If you want to proceed with precise renaming according to the file list, you should turn on "Custom Paths" and use 01 or 11:
Filelist:
c:\docs\file1.txt<=>c:\texts\new-name-for-file1.txt
c:\docs\file2.txt<=>c:\texts\new-name-for-file2.txt
Result:
c:\text\new-name-for-file1.txt
c:\text\new-name-for-file2.txt
If you want to change the names and manually specify folder names by means of vars and extra vars, turn on "Custom Paths", add vars describing your path before calling the plugin, and use either 00 or 10:
Filelist:
c:\docs\file1.txt<=>c:\texts\new-name-for-file1.txt
c:\docs\file2.txt<=>c:\texts\new-name-for-file2.txt
Result:
new-name-for-file1.txt
new-name-for-file2.txt
And finally if you want to use the new names with old paths, use 00 or 10 with "Custom Paths" turned off:
Filelist:
c:\docs\file1.txt<=>c:\texts\new-name-for-file1.txt
c:\docs\file2.txt<=>c:\texts\new-name-for-file2.txt
Result:
c:\docs\new-name-for-file1.txt
c:\docs\new-name-for-file2.txt
I know it seems kinda intricate, but it makes the plugin universal to be used with all types of lists for various purposes.
SR settings:
1) Set "Extension Management" to "None".
2) Set "Custom Paths" according to your needs (see below).
Mode 1 - TWO-LINES.
To work in this mode you should specify only one parameter:
LIST. Provide the full path+name to the filelist suitable for this mode. Example:
list=c:\sr\list32.txt|brutalmode=1|pathmode=01
Mode 2. SEPARATOR.
This mode requires two parameters:
LIST. Provide the full path+name to the filelist suitable for this mode. Each
line must have a separator.
SEPARATOR. This is a symbol or a set of symbols to separate old and new file
names. Within a single file, only one separator can be used. Example for different
files:
c:\docs\file1.txt=c:\texts\new-name-for-file1.txt (separator is "=")
c:\docs\file1.txt{to}c:\texts\new-name-for-file1.txt (separator is "{to}")
c:\docs\file1.txt/c:\texts\new-name-for-file1.txt (separator is "/")
You should use separators that cannot appear in file names, that's why prohibited by the OS symbols are recommended.
Mode 3. SIMPLE-LIST.
This mode is automatically activated when the number of files in the SR file list equals the number of lines in the file described by the LIST parameter and there is no SEPARATOR parameter. It is supposed that you already have 2 files - one for old file names and the other one for new names. Load the list of existing files by means of SR menu "File List -> Import File List". Then specify the name of the second list as "LIST" parameter and call the plugin. This method works only if the first filelist has full paths and it will not work with bare names like "mydoc.txt". I think it's clear that this mode ignores the first digit of PATHMODE parameter - it's always 1. BRUTALMODE is ignored because initial names list and SR list are identical.
Plugin Errors.
If you see M1, M2 or M3 before the error message, it means that the error occurred after the mode was recognized. You should check that the file list complies with the requirements of the recognized mode. If you see that the mode was recognized incorrectly, then you forgot to specify a required parameter, for example, SEPARATOR for mode 2, or your filelist doesn't correspond with the desired mode.
SR Errors.
The majority of the problems will arise because of incorrect "Custom
Paths" state. There is a simple rule: if you see paths before the names
in the first column of the SR list, it means that "Custom Paths" should
be turned on. If you see only bare name, you have two possibilities:
1) leave "Custom Paths" on but add your own path by means of vars.
2) turn off "Custom Paths" and SR will use the paths of original files.
Another mistake is to let SR use extensions. You should always set "Extension Management" to "None" when you work with this plugin.
This example shows how to use the plugin with separated old and new names. In the "tutorial\lists" folder we have randomly sorted files of three categories: FLOWERS, NATURE and SEMICONDUCTORS:
bird.txt, camomile.txt, diode.txt, dragon.txt, fish.txt, resistor.txt, rose.txt, transistor.txt, tulip.txt.
We have a file "tutorial\lists\_files.lst" that has associations for these files. Our task is to create 3 folders for each category and move these files to proper categories:
C:\NEW_CATEGORIES\NATURE - bird.txt, dragon.txt, fish.txt.
C:\NEW_CATEGORIES\FLOWERS - camomile.txt, rose.txt, tulip.txt.
C:\NEW_CATEGORIES\SEMICONDUCTORS - diode.txt, resistor.txt, transistor.txt.
Run SR, load "lists" preset. Go to "External Routines" (F10) and check that the "LIST" parameter is correct - it should point to an existing file "_files.lst" (your path may differ if you installed SR not in "c:\program files\sophisticated rename"). Correct the path if needed and resave the variable and preset. Now add files from "tutorial\lists\*.*". By this moment you should see new names in the preview list. Proceed with renaming - press [APPLY] and check that the files were really moved to "C:\NEW_CATEGORIES\".
Should you have any questions, contact Anatoliy Kovalenko at http://acritum.com.