#1 2016-11-18 11:53

Martin
Member
Registered: 2016-11-18
Posts: 2

How do I create and save to a new folder in batches?

Hi

I Have over a 1000 pictures in the format JPG which I have to sort. So far I have managed to sort them so I have a numerical order in the files that resets every 18th picture. Now I need to save every 18th picture to a new folder named numerical as in 1,2,3,4,5 and so on to a distination of my own choice. I found someone who asked a similar question but I didn't understand the answer to his problem which is close to mine. Please help. If I have 28 pictures then I need 18 of them to go into a folder named "1" and then remaining 10 pictures to go in a folder named "2".

Offline

#2 2016-11-18 12:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: How do I create and save to a new folder in batches?

Hi,

You can do this with a bit of Pascal Script magic (rule), using the following script:

const
  MAX = 18;
var
  Counter, Index: Integer;
begin
  Inc(Index);
  if Counter = 0 then
    Counter := 1;
  if Index >= MAX then
  begin
    Index := 0;
    Counter := Counter + 1;
  end;
  FileName := IntToStr(Counter) + '\' + FileName;
end.

This will prefix each filename with a numbered folder, which is incremented every MAX number of files (as defined in the script).

Here is an example of old and new names if MAX=5:

1.txt    1\1.txt
2.txt    1\2.txt
3.txt    1\3.txt
4.txt    1\4.txt
5.txt    1\5.txt
6.txt    2\6.txt
7.txt    2\7.txt
8.txt    2\8.txt
9.txt    2\9.txt
10.txt    2\10.txt
11.txt    3\11.txt
12.txt    3\12.txt

renamer-batch-move-to-folders.png

Offline

#3 2016-11-20 12:18

Martin
Member
Registered: 2016-11-18
Posts: 2

Re: How do I create and save to a new folder in batches?

Thank you so much. It works big_smile. This just made my life so much easier big_smile.

Offline

Board footer

Powered by FluxBB