Selecting n files

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Rein de Jong
Senior Member
Senior Member
Posts: 394
Joined: 2005-01-30, 20:26 UTC
Location: NL
Contact:

Selecting n files

Post by *Rein de Jong »

Hi,

I give lectures about TC in the Netherlands. I got a question I couldn't answer.

Someone has a directory with plenty of files, say 2000. He wants to select the first 500 of them or at random 500 files. Is there a way of doing this automated with TC. I searched Grey+ combined with a RegEx, but cant find a solution. I tend to think it isn't possible.

And....... No, I don't know why someone wants to do it
:?
Groetjes/
______/Rein

--- Moderator NL-forum ---
zie ook: https://www.reindejong.nl/totcmd
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Code: Select all

#IfWinActive ahk_class TTOTAL_CMD
$^!+Ins::Send, {Ins 500}
SCNR. :mrgreen:
Are you sure he didn't make fun of you?

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.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

http://www.totalcmd.net/plugring/Mover.html

Otherwise you need a content plugin which counts the files in the file list.

Icfu
This account is for sale
User avatar
Rein de Jong
Senior Member
Senior Member
Posts: 394
Joined: 2005-01-30, 20:26 UTC
Location: NL
Contact:

Post by *Rein de Jong »

Hacker wrote:

Code: Select all

#IfWinActive ahk_class TTOTAL_CMD
$^!+Ins::Send, {Ins 500}
SCNR. :mrgreen:
Are you sure he didn't make fun of you?
No, I don't. :?

But Hacker? Where to place this code? It's not a RegEx.
Groetjes/
______/Rein

--- Moderator NL-forum ---
zie ook: https://www.reindejong.nl/totcmd
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

First 500 is one thing next 500 the same and RANDOM 500 is extremely stupid.


I can imagine scenarios like... you get the data in one folder in the group of files that have the same prefix like

Group1 - File001
Group1 - File002
.....
Group1 - File500
Group2 - File001
...
Group2 - File500

So, the mentioned procedure can be used to access eatch group, althouh there are clearly better ways to do it, I can understand that somebody might think in that direction.

Random access doesn't have any real value. One may wan to choose a random file to do something with it, like set the picture as wallpaper but then, it is out of domain of File Managers and simple scripts can be created to do that, similar to Hackers answer above.

----

The code above is AutoHotkey code. You need to have AutoHotKey.exe to execute it. The scripting language is in question, similar to VB/JSScript.

----
SCNR :lol:
If the boy is making fun of you, you make the fun of him and give him to do that as a homework :D

2 icfu
Location: Kibibyte City
ROTFLMAO.... I said that X*** is great source of fun, didn't I

..hm... I guess I didn't, so here it is:
  • X**** is great source of fun, isn't he ?
Habemus majkam!
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

RANDOM 500 is extremely stupid.
Oh, really? Have you an mp3-player? One may need to listen to completely random music each day.

Actually, that's why Lefteous had done this plugin.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

ROTFLMAO.... I said that X*** is great source of fun, didn't I
So you think that icfu've chosen such location because of me? You are silly then :mrgreen:
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Oh, really? Have you an mp3-player?
hm.... you might be right here.
It still stands its not the thing of File Manager. ITs more about your mp3 player witch is extremely stupid :lol:
Habemus majkam!
User avatar
Rein de Jong
Senior Member
Senior Member
Posts: 394
Joined: 2005-01-30, 20:26 UTC
Location: NL
Contact:

Thnxs

Post by *Rein de Jong »

Ok. The problem is solved. Thnxs guys! :P

I think the easiest way is with the plugins mover to select n files and with Lefteous' misc to randomize the files.

I don't use AutoHotKey. I'll take a look at it. I heard/read before of it. It looks like a great tool. :idea:

I'll place the solution in Dutch-forum.
Groetjes/
______/Rein

--- Moderator NL-forum ---
zie ook: https://www.reindejong.nl/totcmd
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

@majkinetor:
I like Kibibytes and I hate this KB nonsense that I have to read everywhere. If I mean a traditional KB, I write KiB. I expect new applications (and also old ones like TC) to respect the SI standard.

It's ok to let the user make his own choice and abbreviate KiB with KB or K of course but the default units have to be correct. We don't live in the IT stoneage anymore.

So, you may start mocking me as well now. :)

Icfu
This account is for sale
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Single user license #329241
PowerPro scripts for Total Commander
User avatar
LVWolfman
Junior Member
Junior Member
Posts: 7
Joined: 2003-03-20, 01:07 UTC
Location: Las Vegas, NV, U.S.A.

Post by *LVWolfman »

Vochomurka wrote:Select N files
Thank you all!

This is the SECOND thing I came here looking for help with today and the second thing for which you'd provided answers.

Yup, I need to be able to select X files out of a list and do something with them quite often. It USED to involve marking a range and trying to get close to my target number.

Now I have the answer and will go try it. Thanks again!
Rick
#23808
Wishing for TotalCommander Linux and TotalCommander OS X
Post Reply