finding long file names??
Moderators: fgagnon, nikos, Site Mods
finding long file names??
I am pretty sure I cannot do this with x2 - I might be able to, if I could use regex on file names, rather than file content - but just thought I would ask - any way to find long file names - say, any over 40 or 50 characters in length?
Assuming x2 cannot - any suggestions on another utility (free, or cheap, preferable) that might?
Reason: I use a product called Jungledisk, which creates a file system on a couple of cloud servers. When it finds an error in the file system - a duplicate file name - it fixes it by renaming one of the offending files, including a long string of characters as part of the name. They are easy to recognize visually - but impossible to search for.
Thanks
Dan
Assuming x2 cannot - any suggestions on another utility (free, or cheap, preferable) that might?
Reason: I use a product called Jungledisk, which creates a file system on a couple of cloud servers. When it finds an error in the file system - a duplicate file name - it fixes it by renaming one of the offending files, including a long string of characters as part of the name. They are easy to recognize visually - but impossible to search for.
Thanks
Dan
It can be done with Everything.
Everything creates an index of (all) files on (all) ntfs volumes. The index consumes about 1 Mb per 100.000 files on my system and the indexing takes a few seconds only.
After indexing enable RegEx in the search options and search for .{40,} to find any file with 40 or more of any character in the name. You can use, i.e., [a-z] to narrow the search.
Note: The current alpha, 1.2.1.451a, seems to be fairly stable. I've been using it since it was released.
Everything creates an index of (all) files on (all) ntfs volumes. The index consumes about 1 Mb per 100.000 files on my system and the indexing takes a few seconds only.
After indexing enable RegEx in the search options and search for .{40,} to find any file with 40 or more of any character in the name. You can use, i.e., [a-z] to narrow the search.
Note: The current alpha, 1.2.1.451a, seems to be fairly stable. I've been using it since it was released.
i have it somewhere in my list to create a new column that gives the length of the filename but it never materialized!
if you don't mind a little scripting (programming) you can use the WSH
http://www.zabkat.com/blog/15Feb09-expl ... t-host.htm
if you don't mind a little scripting (programming) you can use the WSH
http://www.zabkat.com/blog/15Feb09-expl ... t-host.htm
-
- Silver Member
- Posts: 281
- Joined: 2006 Dec 29, 12:56
- Location: Utrecht, NL
If you use Autoit, you might use this little script to insert the length of the filename into the comments column (I changed a script I use, to accomodate this):
Compile it, and create a custom command with description:
Now you can select files, and run the custom command to get the length of the filename in the X2 comments column.
Not sure if this helps though, since it is only useful if you can sort on the comments column with a kind of 'natural sort order' (I can't test it, I'm on Windows 2000 now, which doesn't have natural sort order. It sorts lengths of filenames like '10', '8', '9'). I don't know if it is possible to add padding zeros using this script.
BTW: you'd have to use NTFS as file system.
More BTW: the script touches the files, but a command to set back the original time is also included.
Code: Select all
Dim $file, $filetoken, $filestream, $filetime
$file = $CmdLine[1]
$filenamelength = StringLen($CmdLine[2])
$filetime = FileGetTime($file, 0, 1)
$filestream = FileOpen($file & ":x2_AFScomment", 2)
FileWrite($filestream, StringToBinary($filenamelength, 2))
FileClose($filestream)
FileSetTime($file, $filetime)
Exit
Code: Select all
>> "[path to the compiled script]" "$F" "$N"
Not sure if this helps though, since it is only useful if you can sort on the comments column with a kind of 'natural sort order' (I can't test it, I'm on Windows 2000 now, which doesn't have natural sort order. It sorts lengths of filenames like '10', '8', '9'). I don't know if it is possible to add padding zeros using this script.
BTW: you'd have to use NTFS as file system.
More BTW: the script touches the files, but a command to set back the original time is also included.
Thanks - I have used Everything a little, and had not thought of it - but these Jungledisk volumes are not NTFS. I use locate32 as a file indexer instead.tonne wrote:It can be done with Everything.
Dan
I'll give this a try - thanks.nikos wrote:if you don't mind a little scripting (programming) you can use the WSH
http://www.zabkat.com/blog/15Feb09-expl ... t-host.htm
Dan
option using regex
I've found a way to find long filenames (not pathnames) using the basic find with regex.
In the find files or folders dialog, change the fuzzy match form 100 (exact match) to 0 (activated regular expression matching).
For the filename enter something like:
..........+
This useless example would find filenames 10 characters or longer.
The "." matches any character so ten "." match ten characters.
the "+" matches the previous character 1 or more times, including everything over ten characters.
Setting a pattern of 101 "." followed by the "+" matches filenames over 100 characters in length, including extension.
While this does find them for me, I still don't have an easy way of shortening them. I've been manually renaming them by backspacing a bunch of characters off the end.
Can also use Bulk Rename Utility to find them, it has a minimum character setting, but haven't figured out its unique regex to rename files. Could be good to cut them down to a specific length.
Will keep checking out the other options listed.
In the find files or folders dialog, change the fuzzy match form 100 (exact match) to 0 (activated regular expression matching).
For the filename enter something like:
..........+
This useless example would find filenames 10 characters or longer.
The "." matches any character so ten "." match ten characters.
the "+" matches the previous character 1 or more times, including everything over ten characters.
Setting a pattern of 101 "." followed by the "+" matches filenames over 100 characters in length, including extension.
While this does find them for me, I still don't have an easy way of shortening them. I've been manually renaming them by backspacing a bunch of characters off the end.
Can also use Bulk Rename Utility to find them, it has a minimum character setting, but haven't figured out its unique regex to rename files. Could be good to cut them down to a specific length.
Will keep checking out the other options listed.
I use Long File Name Finder http://www.dcsoft.com/products.htm
french user-2.5.0.2 ULT [Unicode] 23/04/2014 - Win Seven family premium
Re: option using regex
Brilliant way! You deserve for it, just contact me.meatlump wrote:I've found a way to find long filenames (not pathnames) using the basic find with regex.
Cheers!
- FrizzleFry
- Platinum Member
- Posts: 1250
- Joined: 2005 Oct 16, 19:09
Re: finding long file names??
Yes, great too, too!FrizzleFry wrote:instead of actually typing 100 .s you can do .{100}
DEELX Basic Pattern Syntax: Repeat Quantifier
Re: finding long file names??
I've found another option to find long pathnames here:
***
Using just x2 seems more convenient though. Except I haven't been able to make the solution provided here work for me! What am I doing wrong?
Then copy the lines you want to change, and in x2, open a new scrap container and do Actions / Import clipboard.A quick way to do this would be to use the command line.
If you open up a command prompt, change to the folder from which you need to find the file with the longest path (or if you are looking to find the longest file on the whole drive, c: ).
Then use dir /b /s which will give you a long list of files. You can save this to a text file using the following: dir /b /s > filelist.csv
Then you can open up your favourite spreadsheet package, for example Excel and import this csv file. In the B column, use a formula like =Len(A1), and fill that down to the bottom of the list. Then you can sort by column B which will give you the list of files sorted by path length.
***
Using just x2 seems more convenient though. Except I haven't been able to make the solution provided here work for me! What am I doing wrong?
Re: finding long file names??
Curiously, that regexp seems to only work with smaller numbers... for example .{150,} would find anything over 150 characters, but .{200,} fails to find anything, even when they exist. I would posit this has something to do with how x2 internally represents the paths (nikos loves his 8.3 reductions).
Ultimately it's simpler to just use the Characters [S] column, which was essentially designed for this. Double-click on the "Additional Rules" part of the search dialog and create a rule that targets that column and specifies a size-range, looking something like this:
Ultimately it's simpler to just use the Characters [S] column, which was essentially designed for this. Double-click on the "Additional Rules" part of the search dialog and create a rule that targets that column and specifies a size-range, looking something like this: