Select every 7th file...
Moderators: white, Hacker, petermad, Stefan2
Select every 7th file...
I have a about 2200 JPG files named sequentially, e.g: file0000.jpg, file0001.jpg, file0002.jpg, file0003.jpg, etc.
I would like to select every 7th file so that I can delete them.
Is there a way to do this with RegEx or is there a Total Commander script available? I have looked and I have not been able to locate one.
Thanks for your help!
Dave
I would like to select every 7th file so that I can delete them.
Is there a way to do this with RegEx or is there a Total Commander script available? I have looked and I have not been able to locate one.
Thanks for your help!
Dave
AutoHotkey: select every nth File/ select only file number
Hi and welcome Dave.
We can do that by utilizing a AutoHotkey script, which will do:
-- (first YOU should select some or all files)
- TC-command: COPY SELECTED FILENAMES TO CLIPBOARD: (cm_CopyNamesToClip=2017)
- do the wanted counting, and put calculated Lines back on clipboard
- TC-command: LOAD SELECTION FROM CLIPBOARD: (cm_LoadSelectionFromClip=2033)
See f.ex:
viewtopic.php?t=42481&highlight=select
Somehow related:
viewtopic.php?t=43913&highlight=select
There are other tools mentioned too.
HTH?
We can do that by utilizing a AutoHotkey script, which will do:
-- (first YOU should select some or all files)
- TC-command: COPY SELECTED FILENAMES TO CLIPBOARD: (cm_CopyNamesToClip=2017)
- do the wanted counting, and put calculated Lines back on clipboard
- TC-command: LOAD SELECTION FROM CLIPBOARD: (cm_LoadSelectionFromClip=2033)
See f.ex:
viewtopic.php?t=42481&highlight=select
Somehow related:
viewtopic.php?t=43913&highlight=select
There are other tools mentioned too.
HTH?
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
DaveCmd,
AutoHotkey script:
Save as SelectEveryNthFile.ahk. Adjust FileCount and EveryNthFile as necessary. Run it. Place the cursor on the first JPG file and press F10. Magic.
HTH
Roman
AutoHotkey script:
Code: Select all
#NoEnv
FileCount = 2200
EveryNthFile = 7
#IfWinActive, ahk_class TTOTAL_CMD
F10::
DownCount := EveryNthFile - 1
i = %EveryNthFile%
While i <= FileCount
{
SendInput, {Down %DownCount%}{Insert}
i += EveryNthFile
}
Return
HTH
Roman
Last edited by Hacker on 2017-07-19, 10:32 UTC, edited 1 time in total.
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
@Stefan2Stefan2 wrote:first class, Roman.
Perhaps from interest:
For me, "I++" makes more sense for counting than the "I+=EveryNthFile"
For me the counter i count file you (will) pass and not step of the loop, Roman is really premium Class.
@Roman
For me, initialization should be i = EveryNthFile instead of i = 1 to not send any key if you do not have enough file to {down} / {Insert} specially at the end....
Stefan2,
Thank you but I don't think such a simple script deserves so much praise.
nsp,
Roman
Thank you but I don't think such a simple script deserves so much praise.
If you have 2200 JPGs and in each iteration you "process" 7 (move down six times, select one), you don't want to have 2200 iterations (= 2200 x 7 files) but 2200 / 7 iterations.For me, "I++" makes more sense for counting than the "I+=EveryNthFile"
nsp,
True, edited, thank you.initialization should be i = EveryNthFile instead of i = 1 to not send any key if you do not have enough file to {down} / {Insert} specially at the end
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: AutoHotkey: select every nth File/ select only file number
Am I missing something?
Created txt file with the script. Changed the number of files and every n-th file to select. Saved as .ahk file,
TC Mark > copy selected files to clipboard > load selection from file > SelectEveryNthFile.ahk > F10 to run > no selected files
Please help.
Re: AutoHotkey: select every nth File/ select only file number
> copy selected files to clipboard
> load selection from file
? hmm, but irrelevant for the AHK script.
- - -
> SelectEveryNthFile.ahk > F10 to run > no selected files
You have AutoHotkey installed?
Which version?
Re: Select every 7th file...
I don't have AutoHotkey. Downloaded AutoHotkey_1.1.34.04 and unpacked it. Do I need to run AutoHotkeyU64.exe to start the app?
Re: Select every 7th file...
You should not unpack, just install it.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.77
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.77
QAP 11.6.3.3 x64
Re: Select every 7th file...
"D:\rive\Path to\AHK\AutoHotkey.exe" "D:\rive\Path to\your script.ahk"
If you utilize AutoHotkeyU64.exe or AutoHotkeyU32.exe or AutoHotkey.exe doesn't matter here.
If you have AutoHotkey installed, you can just double click the script.ahk file from every where.
more >>> viewtopic.php?p=350976#p350976
Re: Select every 7th file...
It looks like I downloaded the wrong file. AutoHotkey_1.1.34.04.zip
Thanks.
Thanks.
Re: Select every 7th file...
Yes, download the installer.
Its small and doesn't harm your system.
You then can compile scripts with the context menu of ahk files
or start scripts by double click.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.77
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.77
QAP 11.6.3.3 x64