Walkthru for file renaming ...

General discussion related to "Everything".
Post Reply
spazumnator
Posts: 15
Joined: Fri Dec 21, 2018 5:00 pm

Walkthru for file renaming ...

Post by spazumnator » Thu Mar 28, 2019 2:43 pm

Is there a walk thru for file renaming? I have a bunch of irregular named files, that I would like to rename them, into a much more organized format.

I have before, used the "rename" command for this task, but because I do not fully understand the "language", it seems that I lack knowledge, of how to do these sorts of tasks more efficiently than just selecting each and every file, one-by-one to rename.

For example:
What is a more detailed explanation for using the "Old Name" and "New Name" text boxes? When you have a list of file names these boxes now show something in them that is rather a vague representation of what seems to be MSDOS commands.

How do I apply the additional tools to the job by clicking the "right arrow button(s)" which reveals a whole new set of functions? What do the those new functions mean ?

How does explicitly clicking the "Match Case" and "Regex" boxes help my task? Or do I always need too leave them unchecked?

Sorry for being rather uneducated, I have little more than high school basic knowledge.

void
Site Admin
Posts: 5803
Joined: Fri Oct 16, 2009 11:31 pm

Re: Walkthru for file renaming ...

Post by void » Fri Mar 29, 2019 4:33 am

Is there a walk thru for file renaming?
There's a little bit about it here:
/support/everything/results/#multi-file_renaming

I'll try to go into a bit more detail here..
Please ignore regex and match case for now (leave them off)
What is a more detailed explanation for using the "Old Name" and "New Name" text boxes?
Old format and new format define the old filename pattern and new filename pattern.
These two fields are automatically generated, based on the initial filenames.
Depending on the initial filenames, there might not be any noticeable patterns, in which case Everything will use %1 for the old format and new format (%1 on its own will match the entire filename).

%1, %2, %3 have special meaning, these variables capture matched text in the old filenames.
They are essentially a * wildcard (lazily match any character any number of times)

For example, take the following filename:
ABC - 123.txt

If we use old format: %1 - %2
%1 will capture ABC
- will match the literal -
%2 will capture 123.txt
we are essentially searching for: * - *
and storing what * matches in the variables called %1 and %2
we can recall these matches with the new format, for example if we set the new format to
%2 - %1
we would get the following filename:
123.txt - ABC



Changing the "old format" or "new format" will generate new "new filenames".
The "old filenames" and "new filenames" edit boxes allow you to make fine changes that would be difficult with the "old/new format".
How do I apply the additional tools to the job by clicking the "right arrow button(s)" which reveals a whole new set of functions? What do the those new functions mean ?
Functions can be used on captured text, such as changing case.

An example would be to convert all filenames to lowercase:
Set old format to %1
Set the new format to $lowercase(%1)
-old format will match everything, the old filename will be captured in %1
-$lowercase(%1) will be replaced with captured filename in %1 in lowercase.


Some more details that might not be clear:
You can change the old filenames text to help match the old format. Everything will keep a copy of the original old filename that it will use for the rename operation.

If you have any questions, maybe a specific multi-file-rename you are trying to do? please let me know.

Here are some examples which may help:

Batch rename jpeg extension to jpg:
All I have done here is remove the e in New format.


Rename some mp3s:
Notice how %1 captures the track, %2 the artist and %3 the title.
All I have done here is add Hackers - to the start of New format.


Enabling regex gives you more control over the pattern matching, instead of capturing with %1 or %2..., regex uses ( and )
Instead of recalling captured groups with %1 and %2 ..., regex uses \1 and \2 ...
regex also replaces all occurrences.

froggie
Posts: 172
Joined: Wed Jun 12, 2013 10:43 pm

Re: Walkthru for file renaming ...

Post by froggie » Fri Mar 29, 2019 1:58 pm

I don't see where the functions for renaming are documented. Are there others besides $lowercase and $uppercase?

void
Site Admin
Posts: 5803
Joined: Fri Oct 16, 2009 11:31 pm

Re: Walkthru for file renaming ...

Post by void » Fri Mar 29, 2019 3:00 pm

They are listed when you click the right pointing arrow to the right of the New Format edit.

Currently the function list is:
  • $pathpart()
  • $strippath()
  • $striproot()
  • $uppercase()
  • $lowercase()
  • $titlecase()
I do plan to add more functions, such as $index and $count and some basic expression support, such as $expr($index + 1)

froggie
Posts: 172
Joined: Wed Jun 12, 2013 10:43 pm

Re: Walkthru for file renaming ...

Post by froggie » Fri Mar 29, 2019 3:14 pm

This is great. Very useful.

Could you please add the contents of this post to the online help?

void
Site Admin
Posts: 5803
Joined: Fri Oct 16, 2009 11:31 pm

Re: Walkthru for file renaming ...

Post by void » Sat Mar 30, 2019 7:30 am

I'll add a dedicated support page with this information.

spazumnator
Posts: 15
Joined: Fri Dec 21, 2018 5:00 pm

Re: Walkthru for file renaming ...

Post by spazumnator » Sun Mar 31, 2019 6:14 pm

Thanks for the explanation @void. It helps clarify some mistakes that I was making using the tools.

I had a multi-file, selection of files that were also mixed with .ext named files of different types - i.e. .jpg and .txt in the same folder. My intent was too rename and move these files from arbitrary names too similar named files.

Your note clearly explains this:
Note: multi-file renaming works best when the selected files share similar formats

My effort produced results that were unexpected, so my first reaction was "I do not understand why this result happened", "I only wanted file renaming and file moving".

I really cannot expect a Swiss army knife. Maybe, in time; you could create a software interface for such file manipulation.

The General
Posts: 2
Joined: Sun Jun 23, 2019 6:36 am

Re: Walkthru for file renaming ...

Post by The General » Tue Jul 09, 2019 7:11 am

These functions are great to use with file-renaming.
I have one question though, about the workings of $titlecase().
Whenever I use $titlecase(%1), then each word gets a capital. I would like the whole variable to be with only the first word getting a capital.
Is there a way to do this ?
For Example:
Kruder & Dorfmeister - Original Bedroom Rockers.flac
The $titlecase(%2) would become "Original bedroom rockers"

NotNull
Posts: 2392
Joined: Wed May 24, 2017 9:22 pm

Re: Walkthru for file renaming ...

Post by NotNull » Tue Jul 09, 2019 3:17 pm

The General wrote:
Tue Jul 09, 2019 7:11 am
Is there a way to do this ?
Not with Everything. In such cases, you are better of with specialized rename utilities like Bulk REname Utility, Advanced Renamer, PFrank, ...

void
Site Admin
Posts: 5803
Joined: Fri Oct 16, 2009 11:31 pm

Re: Walkthru for file renaming ...

Post by void » Wed Jul 10, 2019 9:50 pm

Thanks for the suggestions The General.

Adding more functionality to the multi-file renamer in Everything is on my TODO list.
I'll add a sentence case function, eg: $sentencecase(%1)

I'm also working on formatting functions, something like the following is planned:
<upper:<left:%1>,1><lower:<right:%1,len:%1-1>>

The General
Posts: 2
Joined: Sun Jun 23, 2019 6:36 am

Re: Walkthru for file renaming ...

Post by The General » Thu Jul 11, 2019 11:09 am

void wrote:
Wed Jul 10, 2019 9:50 pm
Thanks for the suggestions The General.

Adding more functionality to the multi-file renamer in Everything is on my TODO list.
I'll add a sentence case function, eg: $sentencecase(%1)

I'm also working on formatting functions, something like the following is planned:
<upper:<left:%1>,1><lower:<right:%1,len:%1-1>>
Both functions sound really good. 8-)
Ok, we'll have to wait until you find the time.
Thank you for your quick response.

Stamimail
Posts: 751
Joined: Sat Aug 31, 2013 9:05 pm

Re: Walkthru for file renaming ...

Post by Stamimail » Thu Nov 19, 2020 11:18 pm

froggie wrote:
Fri Mar 29, 2019 3:14 pm
This is great. Very useful.

Could you please add the contents of this post to the online help?
+1

Another suggestions:
1. Consider adding a "Ignore Extension" checkbox.
2. I think the grouping concept (the ability of capturing groups like Regex does by parentheses) is missing in the default method (Does it have a name by the way?).
For example, if you have:
Old format: %1.jpeg
You can't enclose the "jpeg" text, and doing something like:
Old format: %1.<jpeg>
New format: %1-%2.%2
New filenames:
x-jpeg.jpeg
y-jpeg.jpeg
z-jpeg.jpeg

I think it is easier to group existing text than replacing it with %1 %2 ...

3. "Rename some mp3s:" is a classic case for renaming.
The problem is with the Format that was first created - the Format that "automatically generated, based on the initial filenames".
In the current behavior, it will usually generate:
Old format: %1.flac
instead of:
Old format: %1 - %2 - %3.flac

I think changing the current behavior to a behavior that takes into account classic cases, will make Rename much easier to use and understand.

You can also add a new option/field to Rename:
"generate format by delimiter: [_______]"
where the user will type " - " to generate the
Old format: %1 - %2 - %3.flac

void
Site Admin
Posts: 5803
Joined: Fri Oct 16, 2009 11:31 pm

Re: Walkthru for file renaming ...

Post by void » Fri Nov 20, 2020 6:03 am

Thanks for the suggestions Stamimail,

An option to ignore extensions when renaming is on my TODO list.

Everything does treat the . differently when generating the old/new format. Everything will always look for the . if no pattern is found. I would like to do the same with - ...Added to my TODO list.

therube
Posts: 2760
Joined: Thu Sep 03, 2009 6:48 pm

Re: Walkthru for file renaming ...

Post by therube » Fri Nov 20, 2020 5:29 pm

Note that the "suggested" Old/New format: need not necessarily be used - you can roll your own.

In the above mp3 example, %1 - %2 - %3.flac,
Old: %1.flac
New: Hackers - %1.flac
would have worked just as well.

Or you could make other adjustments that better fit your needs.


And a great tip, IMHO, Replace word in rename dialog across multiple files.

Stamimail
Posts: 751
Joined: Sat Aug 31, 2013 9:05 pm

Re: Walkthru for file renaming ...

Post by Stamimail » Sat Nov 21, 2020 4:59 pm

My direction is to make Everything more intuitive, which means even if you are a new user you will know what to do without the need for help information.
Find & Replace is a good example for the user's need to extend the options in Everything to do the same thing more easily.
Currently, such options can be found in more professional renaming tools, like Renamer.
Maybe Everything can support the common tasks or leave this for add-ons...

Post Reply