You are not logged in.
Pages: 1
I have 600,000 midi files, in a single folder. I'd like to move/organize into sub-folders. 100 midi files per new folder. Sorted by size of files.
So, the smallest 100 midi files will go into, say, folder 0001.
Second 100 smallest midi files will go into folder 0002.
Etc.
Will need to create all the required folders.
Using Renamer:
-- Import the folder containing the files.
-- Sort all the files by size, smallest at top.
-- Serialize, Incremental, Pad with zeros, Prefix
-- Insert "\", Where, Position 4
Preview. Rename. Exit.
Then run Renamer again:
-- Import the folder containing the files.
-- Delete, From, Position 3
to remove the numbers which were added at the beginning of each filename.
The above approach works for groupings in multiples of 10.
Is there any other way Renamer can accomplish the task?
Thanks!
Nicholas Kormanik
Offline
You can use PascalScript to automatically insert the batch number folder prefix. You also don't need to create any folders manually because ReNamer automatically creates new folder structures for a file, if required.
For example, a script below will insert "1\", "2\", "3\" and so on, every 5 files (adjustable via BatchSize constant):
const
BatchSize = 5;
var
NextBatch: Boolean;
BatchNumber: Integer;
FilesInBatch: Integer;
begin
NextBatch := (BatchNumber = 0) or (FilesInBatch mod BatchSize = 0);
if NextBatch then
begin
BatchNumber := BatchNumber + 1;
FilesInBatch := 0;
end;
FilesInBatch := FilesInBatch + 1;
FileName := IntToStr(BatchNumber) + '\' + FileName;
end.
Result in something like this:
Name New Name
0001.midi 1\0001.midi
0002.midi 1\0002.midi
0003.midi 1\0003.midi
0004.midi 1\0004.midi
0005.midi 1\0005.midi
0006.midi 2\0006.midi
0007.midi 2\0007.midi
0008.midi 2\0008.midi
0009.midi 2\0009.midi
0010.midi 2\0010.midi
0011.midi 3\0011.midi
0012.midi 3\0012.midi
Additional formatting of the batch number folder prefix can be done either in the script, or in a second pass by adding just the folders for renaming.
Offline
On a second thought, you can also use a standard Serialize rule:
1) Insert: Insert "\" as Prefix (skip extension)
2) Serialize: Serialize Incremental from 1 step 1 repeat 5 and pad to length 4 as Prefix (skip extension)
Result:
0001.midi 0001\0001.midi
0002.midi 0001\0002.midi
0003.midi 0001\0003.midi
0004.midi 0001\0004.midi
0005.midi 0001\0005.midi
0006.midi 0002\0006.midi
0007.midi 0002\0007.midi
0008.midi 0002\0008.midi
0009.midi 0002\0009.midi
0010.midi 0002\0010.midi
0011.midi 0003\0011.midi
0012.midi 0003\0012.midi
Offline
Wow. A triple solution. ReNamer is one powerful program.
Thanks so much!
Offline
With the power of the pascal-script code-editor support, ReNamer can do much more than just rename, so you can develop your own rename-automation script, or even launch a 3rd party exe developed in other language to do the hard job, things like that are awesome, and every day I'm more convinced that ReNamer is the best renaming application on the Earth (but it still having the lack of real-time string-replacement previews! ).
Have a nice day, every one.
Last edited by Elektro (2016-03-25 22:53)
Offline
Pages: 1