Long file names - how to replace text in path

Discussion related to "Everything" 1.5 Alpha.
Post Reply
eswul62
Posts: 129
Joined: Wed Jul 31, 2013 6:07 am

Long file names - how to replace text in path

Post by eswul62 »

One rootfolder with -many- subfolders.
Files are sorted by path length.
Quite a number exceed the max of 255 characters.

Now, I would like to find and replace text in the path so as to shorten it. Some texts are double, or simply not necessary.

Any suggestions?

Thanks!
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: Long file names - how to replace text in path

Post by therube »

Depending on what you've got, & just what you want to get to, these might help:

Rename - Randomize Function
Copy Tree structure objects from result List
Merge Directory Structures
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Long file names - how to replace text in path

Post by void »

To search for files/folders with a path that exceeds 259 characters, include the following in your search:

path:len:>259

259 is the maximum number of characters the Windows Shell can handle.



Advanced rename can batch rename these files/folders with long filenames.

To advanced rename files/folders:
  • Select the long filenames in Everything.
  • Press F2.
  • Uncheck regular expressions.
  • Set the old format to the find text.
  • Set the new format to the replacement text.
  • Review the newly generated filenames.
  • Click OK.


Advanced move can batch move these files/folders with long paths.

To advanced move files/folders:
  • Select the long filenames in Everything.
  • From the Edit menu, under the Advanced submenu, click Advanced move to folder.
  • Check regular expressions.
  • Set the old format, for example: ^(.*)\\[^\\]*\\([^\\]*)$
  • Set the new format, for example: $1:\\$2:
    (this will remove the last path part)
  • Review the newly generated filenames.
  • Click OK.
Please let us know some example filenames if you need help with this.
eswul62
Posts: 129
Joined: Wed Jul 31, 2013 6:07 am

Re: Long file names - how to replace text in path

Post by eswul62 »

Thanks for the above.

Whilst Everything is set to its default filter, then I am afraid I can't get Everything to rename the folder names, i.e. renaming (F2) will apply on the file names.

Of course I could set the filter to "Folder" and sort on path length. However, in that case the files within those folders are excluded in the path length.

For example, when Filter is to Folder:
a path length of the folder may show up as 240 - excluding the file name in that folder (e.g. 20 characters), so the actual total path length is 260.

I believe there is a column named "Maximum Component Length". I think it is limited to 255 charactersL it will include the file name length upto 255 characters. Likely this is hardcoded: vainly searched for settings and in the .ini to increase this number to, let's say, 300.

See below:
Everything-Full Path Length-Max Component Length-03112023 063236.png
Everything-Full Path Length-Max Component Length-03112023 063236.png (12.45 KiB) Viewed 1276 times
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Long file names - how to replace text in path

Post by void »

Please try the following:



Change your search to:

file:path:len:>259

This will show all files that have a really long full path and name.

Select all these files and press Ctrl + Shift + C
This will copy the filenames to your clipboard.



Change the search to:

childfilelist1:

Hold down Ctrl and click the childfilelist1: text in the search box.

Paste your filenames and click OK.

Everything will now list folders that contain a file with a really long filename (> 259 characters)

You can rename the folders from there..

childfilelist1:
Advanced Rename



The maximum component length is for the name part.
The name part (without the path part) cannot exceed 255 characters.
eswul62
Posts: 129
Joined: Wed Jul 31, 2013 6:07 am

Re: Long file names - how to replace text in path

Post by eswul62 »

As always: thanks a lot!

Normally I wouldn't go beyond -say- 240-245 characters (total path length)

In this specific case, these were saved/exported mail attachments, including include 'Domain', 'From' and 'To' and 'Subject' of the email in the path.
So I would know what the file was/is about, as well as sender name.

However, all this resulted in total path lengths if 300 characters and it should be addressed: cut down to 240.
This being the background of my question.

Anyway, thanks again.
Post Reply