finding long file names??

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

kronhead
Member
Member
Posts: 10
Joined: 2007 Apr 29, 00:41

finding long file names??

Post by kronhead »

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
tonne
Member
Member
Posts: 25
Joined: 2006 May 26, 10:35

Post by tonne »

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.
User avatar
nikos
Site Admin
Site Admin
Posts: 15800
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

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
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

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):

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
Compile it, and create a custom command with description:

Code: Select all

>> "[path to the compiled script]" "$F" "$N"
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.
kronhead
Member
Member
Posts: 10
Joined: 2007 Apr 29, 00:41

Post by kronhead »

tonne wrote:It can be done with Everything.
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.

Dan
kronhead
Member
Member
Posts: 10
Joined: 2007 Apr 29, 00:41

Post by kronhead »

Mr.Pleasant wrote:If you use Autoit, you might use this little script to insert the length of the filename into the comments column

BTW: you'd have to use NTFS as file system.
Thanks - I am not familiar with Autoit, but will check it out - but the Jungledisk volumes are not NTFS, also.

Dan
kronhead
Member
Member
Posts: 10
Joined: 2007 Apr 29, 00:41

Post by kronhead »

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
I'll give this a try - thanks.
Dan
kronhead
Member
Member
Posts: 10
Joined: 2007 Apr 29, 00:41

Post by kronhead »

Thanks for all the suggestions. I ended up using another scripting tool I have - Autohotkey. Hadn't thought of that at first - had only done some simple keyboard macros with it - but it worked great.

Again, thanks again for the help.
Dab
meatlump
New Member
Posts: 3
Joined: 2011 Dec 22, 04:03

option using regex

Post by meatlump »

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.
User avatar
lian
Bronze Member
Bronze Member
Posts: 95
Joined: 2005 Feb 09, 14:17
Contact:

Post by lian »

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
tgaleta
Member
Member
Posts: 17
Joined: 2011 Feb 15, 07:53
Contact:

Re: option using regex

Post by tgaleta »

meatlump wrote:I've found a way to find long filenames (not pathnames) using the basic find with regex.
Brilliant way! You deserve :beer: for it, just contact me.
Cheers!
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Re: finding long file names??

Post by FrizzleFry »

instead of actually typing 100 .s you can do .{100}

DEELX Basic Pattern Syntax: Repeat Quantifier
tgaleta
Member
Member
Posts: 17
Joined: 2011 Feb 15, 07:53
Contact:

Re: finding long file names??

Post by tgaleta »

FrizzleFry wrote:instead of actually typing 100 .s you can do .{100}

DEELX Basic Pattern Syntax: Repeat Quantifier
Yes, great too, :beer: too!
Kalinka
New Member
Posts: 6
Joined: 2017 May 02, 10:18

Re: finding long file names??

Post by Kalinka »

I've found another option to find long pathnames here:
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.
Then copy the lines you want to change, and in x2, open a new scrap container and do Actions / Import clipboard.

***

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?

Image
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: finding long file names??

Post by Kilmatead »

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). :shrug:

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:

Image
Post Reply