Display files in folder with their sequential number

English support forum

Moderators: Hacker, petermad, Stefan2, white

gonen52
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-11, 14:24 UTC

Display files in folder with their sequential number

Post by *gonen52 »

Hi

Is there a way to display a sequential number of a file in folder ?

for example:

I need to sort files in directory by name, and see which is the 56th file in the list etc.

can someone suggest the easiest way to access directly file number nn in a folder ?

thank you !!!
User avatar
petermad
Power Member
Power Member
Posts: 16141
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

You could use the multi-rename tool to put sequential numbers in front of each file name - you don't have to perform the actual rename operation, but just use the preview of the new names to see the number of the file.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gonen52
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-11, 14:24 UTC

Post by *gonen52 »

thanks - but this is good for one time ..... as I need to run some operations on the files... e.g. DELETE - which will cause seq numbers to change...

I wonder if there is a way to display a selected file seq number at the bottom of the screen (like it shows the size of selected files / number of files)

thanks
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

gonen52,
I don't see any practical use of file number.
Why do you need file numbers? Especially if they will change if you delete/add file(s)?
gonen52
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-11, 14:24 UTC

Post by *gonen52 »

very simple.

I got a usb drive with many songs on.

I got list of files to modify. the list include only song number (as displayed on the usb player screen)

the guy send me "song" number and the change he ask for.

the songs are sorted by name.

if you go from bottom to top - you can delete files while number of the rest of the files left unchanged.

so all I need is quick access to file #nn in directory (or see its number somewhere...)


hope I am clear.


thank you !!!
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think in such case you need extra filelist anyway (e.g. text editor with line numbers).

BTW you may use file comments for numbering. This batch will enumerate files (sorted by names) in a given folder with comments 000001, 000002 etc. so you can see numbers in a comment column of custom column set (and even sort by them):

Code: Select all

@echo off
if -%1==- echo Parameters: %%P & pause & goto :EOF
if exist "%~1\descript.ion" (
	if exist "%~1\descript.~ion" ( del "%~1\descript.ion" ) else ( ren "%~1\descript.ion" "descript.~ion" )
)
set filenum=0
set descfile="%~1\descript.ion"
for /f "usebackq delims=" %%f in (`dir /b /on /a:-d %1`) do call :nextfile "%%f"
goto :EOF

:nextfile
set /a filenum=%filenum%+1
set filenum_d=00000%filenum%
echo %1 %filenum_d:~-6% >> %descfile%
goto :EOF
Just save as somename.CMD and drag onto buttonbar, then specify %P in parameters field. And, you may need to enable TC option to read DOS file comments to see numbers for names with non-English characters. It will backup your existing descript.ion file.
gonen52
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-11, 14:24 UTC

Post by *gonen52 »

Thank you very much for your help !!!!

I did this:
created the .cmd file
added to the buttonbar with %P parameter
clicked and the bat ran OK !
created file descript.ion

I miss the next step.... How to use this ion file so that its data will be used as input to TC ?

one more step and I got it !!!

thank you again
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

In TC menu go to "Show\Custom Columns Mode\Configure Custom Columns" and setup new column set with desired fields plus field tc.comment. Then switch to that column set to see comment column.

Also go to Configuration dialog, Operation section and check boxes "DOS charset" and "Read from both" in "File comments" group.
gonen52
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-11, 14:24 UTC

Post by *gonen52 »

Done

Show comments and its perfect for me !!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Many thanks
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Great that it does what you need. :)
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Or simply Show - Comments. ;)

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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Hacker,
In such view mode we can't sort by comments...
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

MVV,
Do we need that since the files are already sorted by name anyways?

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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think separate column set is more useful, it allows to see other columns too.
sorcar
Member
Member
Posts: 100
Joined: 2005-04-12, 17:45 UTC
Location: U.S.

Post by *sorcar »

Genius MVV! Just to let you know that this batch file is extremly useful for me for a whole different reason. Thanks.
Last edited by sorcar on 2013-07-19, 22:11 UTC, edited 1 time in total.
Post Reply