07-31-2019, 01:08 AM
Hi,
I have n files in a folder, they are named by number such as: 1.jpg, 2.jpg, 3.jpg, 4.jpg and so on, for example, until 30.jpg.
I would like to extract into a new folder files in increments of 3, such as 1.jpg, 4.jpg, 7.jpg, 10.jpg, and so on.
I wrote the script below:
int i
ARRAY(str) a
GetFilesInFolder a "$Desktop$\I1\" ""
a.sort(8)
for i 0 a.len
,str s1=a[i]
,out s1 ;;ORIGIN FILES
,str s2=F"C:\Users\emers\Desktop\I2\{i+1}.jpg"
,out s2 ;;DESTINATION FOLDER
, ren s1 s2
but that would move ALL the files to folder I2.
Could someone tell how this works?
Thank you
Emerson
I have n files in a folder, they are named by number such as: 1.jpg, 2.jpg, 3.jpg, 4.jpg and so on, for example, until 30.jpg.
I would like to extract into a new folder files in increments of 3, such as 1.jpg, 4.jpg, 7.jpg, 10.jpg, and so on.
I wrote the script below:
int i
ARRAY(str) a
GetFilesInFolder a "$Desktop$\I1\" ""
a.sort(8)
for i 0 a.len
,str s1=a[i]
,out s1 ;;ORIGIN FILES
,str s2=F"C:\Users\emers\Desktop\I2\{i+1}.jpg"
,out s2 ;;DESTINATION FOLDER
, ren s1 s2
but that would move ALL the files to folder I2.
Could someone tell how this works?
Thank you
Emerson