Scan to find length of path/file names?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
spikey
Member
Member
Posts: 123
Joined: 2005-07-20, 08:37 UTC

Scan to find length of path/file names?

Post by *spikey »

Is it possible to use TC to scan to find path\file names which exceed a certain value.

For example, I want to list all path\file names over 255 characters within a particular directory.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7022
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

TC Everything searches
ev:yourfolder len:>255
ev:file:*.* len:>255
ev:folder:*.* len:>255
Last edited by Horst.Epp on 2016-11-11, 14:39 UTC, edited 2 times in total.
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1396a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.6 x64
User avatar
Dalai
Power Member
Power Member
Posts: 10033
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

There's also a way without Everything: Install plugin Filename_ChrCount. Afterwards you can use the field "Pathname (ChrCount)" in TC's Find Files, tab Plugins, to check whether the paths exceed a certain length, in your case 255.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: Scan to find length of path/file names?

Post by *Stefan2 »

spikey wrote:Is it possible to use TC to scan to find path\file names which exceed a certain value.

For example, I want to list all path\file names over 255 characters within a particular directory.
Depending on what to do with the result, I would do it perhaps with PowerShell:

Code: Select all

PS H:\temp>

PS H:\temp>dir -rec *.txt |select FullName, @{L="PathLen";E={($_.FullName).Length}}|sort PathLen -desc|Export-Csv zzzPathLen.csv

PS H:\temp>

zzzPathLen.csv

Code: Select all

H:\temp\NewFileFromTemplate\ShellNew\%Y-%m-%d Work folder structure\Sub Folder1\01 Order\%Y-%m-%d_KONTAKT.txt,"109"
H:\temp\SubFolders\SubFolder-01-03\Sub03Folder-01-01\Sub03Folder-Sub01\Space between lower upper regex.txt,"106"
H:\temp\PS\Encode2UTF8\sub folder\List of Zwei- drei-stellige Namen Songs music.txt.orig.txt,"92"
H:\temp\PS\Encode2UTF8 - Kopie\sub folder\List of Zwei- drei-stellige Namen Songs music.txt,"91"
H:\temp\001 space\_ aaaa TEST AllowedChars03  '   Apostrophe (single quotation mark) #.TXT,"90"
H:\temp\AutoHotkey 1.0.48.05_(30-Sep-2013)-TESTS\Extras\Editors\UltraEdit\Separators.txt,"88"


- - -

Clarifying:

dir -rec *.txt |
select FullName, @{L="PathLen";E={($_.FullName).Length}} |
sort PathLen -desc |
Export-Csv zzzPathLen.csv


Get-ChildItem -Recurse *.txt |
Select-Object FullName, @{   Label="PathLen"; Expression={($_.FullName).Length}   } |
Sort-Object PathLen -Descending |
Export-Csv zzzPathLen.csv


- - -

Alternative:

Get-ChildItem -Recurse *.txt |
Select-Object FullName, @{ Label="PathLen"; Expression={($_.FullName).Length} } |
Sort-Object PathLen -Descending |
Select-Object -First 15 |
Export-Csv zzzPathLen.csv

or rather:

Get-ChildItem -Recurse *.txt |
Select-Object FullName, @{ Label="PathLen"; Expression={($_.FullName).Length} } |
Sort-Object PathLen |
Select-Object -Last 15 |
Export-Csv zzzPathLen.csv


Just an idea 8)
 
User avatar
spikey
Member
Member
Posts: 123
Joined: 2005-07-20, 08:37 UTC

Post by *spikey »

Thanks for the feedback guys. I have a got at some of those solutions.
User avatar
spikey
Member
Member
Posts: 123
Joined: 2005-07-20, 08:37 UTC

Post by *spikey »

Dalai wrote:There's also a way without Everything: Install plugin Filename_ChrCount. Afterwards you can use the field "Pathname (ChrCount)" in TC's Find Files, tab Plugins, to check whether the paths exceed a certain length, in your case 255.
I am a bit confused. I have Everything installed as a standalone program. Are you saying there is a way to integrate Everything into TC?

I have used the ChrCount method and it works reasonably well. It would be nicer still if the character count for a file/path was also displayed.
Last edited by spikey on 2016-11-14, 21:16 UTC, edited 2 times in total.
User avatar
spikey
Member
Member
Posts: 123
Joined: 2005-07-20, 08:37 UTC

Post by *spikey »

Posted in error - please ignore.
Post Reply