Using everything as renamer tool

General discussion related to "Everything".
Post Reply
deajan
Posts: 5
Joined: Mon Apr 18, 2022 8:19 pm

Using everything as renamer tool

Post by deajan »

Hello,

Just found out about this absolute genius piece of software.
Downloaded, tried, and yes ! That's a nice search tool.

I've quickly played with the rename tool too, seems nice, but I was asking myself if regexes could be of use here.

Example: My customers have lot of files like " something.pdf" where the file begins with a space ! (yes they do :s)
Of course, I need to remove the prepending space in order for the files to become "cloud worthy".
I also generally stumble upon a couple of files forbidden symbols (#, %...) depending on the cloud software used (nextcloud, onedrive...).

I'd love to be able to replace / delete those characters with simple regexes:
Example:

Code: Select all

REGEX .*\\(.*)  SUBSTITUTION $1$2 would remove prepenting spaces from filenames
REGEX [~"#%&*<>?{|}] SUBSTITUTION (none) would remove all the given special characters from filename
So far I did that job with a bash script using find then rename the files using sed regexes, but under Windows the performance using a bash port (mine is busybox-w32) is abyssal.

Is there any chance Everything can do that kind of job ?

Best regards.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Using everything as renamer tool

Post by NotNull »

Yes, sure. In Everything:
  • Make sure Match Path and Regular Expressions are NOT enabled ( in the Search menu )
  • In Everything, search for

    Code: Select all

    startwith:" "
  • Select all files ( 'CTRL + A')
  • Press 'F2' to start the multi-file renamer
  • Enable regular expressions
  • Old Format =
    ^ (.*)$
    or
    ^[ ]+(.*)$
    if you expect multiple leading spaces
  • New Format =
    \1
  • Check if all is OK in the New Filenames box
  • Press the OK button
  • Done!

EDIT:
Missed the # and % part...
  • Make sure Match Path and Regular Expressions are NOT enabled ( in the Search menu )
  • In Everything, search for
    %|#
  • Select all files ( 'CTRL + A')
  • Press 'F2' to start the multi-file renamer
  • Enable regular expressions
  • Old Format =
    [#%]
  • New Format =
    (empty)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Using everything as renamer tool

Post by raccoon »

deajan: You should install Everything v1.5 Alpha before continuing this discussion.

Note that Advanced Rename is for filenames only, and Advanced Move To Folder is for renaming and relocating full path\filesnames. Same function, but Advanced Rename lowers risk of accident.
deajan
Posts: 5
Joined: Mon Apr 18, 2022 8:19 pm

Re: Using everything as renamer tool

Post by deajan »

I was actually using Everything v1.5 since I read somewhere that a rename function was being build.
I actually tried to play with the advanced renamer...
But shame on me, I just did not read the "Regular Expressions" checkbox, and wondered why the renaming syntax was too simple.

Thank you guys ;)
deajan
Posts: 5
Joined: Mon Apr 18, 2022 8:19 pm

Re: Using everything as renamer tool

Post by deajan »

As a side question, is there any way to achieve this renaming behavior on directories too ?
deajan
Posts: 5
Joined: Mon Apr 18, 2022 8:19 pm

Re: Using everything as renamer tool

Post by deajan »

>> As a side question, is there any way to achieve this renaming behavior on directories too ?
raccoon wrote: Mon Apr 18, 2022 9:42 pm Note that Advanced Rename is for filenames only, and Advanced Move To Folder is for renaming and relocating full path\filesnames. Same function, but Advanced Rename lowers risk of accident.
Well I'll help myself out of here, I'm definitly too tired to read properly ;)
Thank you alot.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Using everything as renamer tool

Post by NotNull »

deajan wrote: Mon Apr 18, 2022 9:50 pm As a side question, is there any way to achieve this renaming behavior on directories too ?
Multi-renaming works on files as well as folders.
I would do the files first and then the folders as a folder might contain a file that needs renaming. And that might end in a case of cutting the treebranch you are sitting on ...

To select just files, add file: to your search query. I.e.:
file: startwith:" "


Use
folder:
for - you guessed it ;) - .. folders
(and sort the results by Path, descending to prevent treebranch issues)


(I edited my original message with a method to remove # and % )

BTW: All this works on Everything 1.4 as well as 1.5.
deajan
Posts: 5
Joined: Mon Apr 18, 2022 8:19 pm

Re: Using everything as renamer tool

Post by deajan »

NotNull wrote: Mon Apr 18, 2022 9:39 pm EDIT:
Missed the # and % part...
  • Make sure Match Path and Regular Expressions are NOT enabled ( in the Search menu )
  • In Everything, search for
    %|#
  • Select all files ( 'CTRL + A')
  • Press 'F2' to start the multi-file renamer
  • Enable regular expressions
  • Old Format =
    [#%]
  • New Format =
    (empty)
I figured that part out once you pointed out that there was a "enable regular expressions" button ;)

Thanks for your help, really appreciated especially at this kind of hour (it's 0:15am here).
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Using everything as renamer tool

Post by NotNull »

deajan wrote: Mon Apr 18, 2022 10:13 pm Thanks for your help, really appreciated especially at this kind of hour (it's 0:15am here).
Here too :D
(and you're welcome!)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Using everything as renamer tool

Post by raccoon »

Hidden feature.

The Advanced Rename/Move allows for global (several) substring replacements for A) regex patterns, B) non-regex patterns IF no %1 %2 %3 are utilized in the New Format substitution. Examples:

Non-Regex: Replace all dots with space-hyphen-space. OldFormat: ".", NewFormat: " - " (note that NewFormat does not contain %1)
Regex: Replace all vowels with letter x. OldFormat: "[aeiou]", NewFormat: "x"
Regex: Replace all vowels with extra vowel. OldFormat: "([aeiou])", NewFormat: "\1\1"
Post Reply