other information n the custom columns

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
KAC
New Member
New Member
Posts: 1
Joined: 2013-07-02, 15:56 UTC

other information n the custom columns

Post by *KAC »

Is it possible to display content of text file "title" which located in the folder "/spectrum/"?

I have many directories. They have all same structure like this:
folder1/
file1.exe
file2.rar
fileN.ext
title

folder2/
file1.exe
file2.rar
fileN.ext
title

and so on

Each file "title" contains one string with important information of whole folder. Folder name does not mean anything. So I would like to see list of directories with custom column which is content of title file.
Is it possible?

Any ideas are welcome please. So far TC can offer show only atributes of file: dates, sizes, hidden, etc.

Or may be it is better to rename all folder with respect to the title content?
How to do this?
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

You can use the descript.ion file for that.
Create a description manually with Ctrl+Z and display the description column with Ctrl+Shift+F2.

To create a description file from your "title" files use this as "something.cmd" from the root folder "spectrum".

Code: Select all

FOR /R %%I IN (.) DO (
  FOR /F %%R IN (%%~fI\title) DO (
    ECHO "%%~nI" %%R >>descript.ion
  )
)
If the "title" contains more than one row it gets a little more complicated.
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

2KAC

You could use a script for Lev Freidin's Script Content Plugin:


DirDescFromChildFile.vbs

Code: Select all

'*** DirDescFromChildFile.vbs, V1.0, 02.07.2013, van Dusen
'*** Script for Script Content Plugin 0.2
'*** Lev Freidin (c) 2005-2008
'*** http://www.totalcmd.net/plugring/script_wdx.html
'*** http://wincmd.ru/plugring/script_wdx.html

sFile = filename & "\title"
sFileContent = "n/a"

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(sFile) Then
	Set f = fso.OpenTextFile(sFile, 1)
	sFileContent = f.Read(2048)
	Set f = Nothing
End If

content = sFileContent
Set fso=nothing

script.ini

Code: Select all

[Script]
Section=DirDescFromChildFile

[DirDescFromChildFile]
Script=DirDescFromChildFile.vbs
LongName=0
ParseDirs=1

script.lng

Code: Select all

[eng]
Result=FolderDescription

[deu]
Result=Ordnerbeschreibung
Note: AFAIK, Localized column names from language section "[eng]" ("FolderDescription" instead of default column name "Result") are only provided, if you have installed and configured an dedicated english language file (<wincmd.ini>, section "[Configuration]", key/value "LanguageIni=wcmd_eng.lng") (TC derives the language short name ("eng") from it)
Post Reply