Multi-rename character count

Suggestions and feature requests.
Post Reply
Message
Author
lgilbert99
Posts: 9
Joined: 22.03.2019, 16:47

Multi-rename character count

#1 Post by lgilbert99 » 22.01.2023, 21:49

I use the multi-rename feature daily. I use the "Name from x,y characters" and related features a lot. Unless I am missing something, I find myself having to count the characters over and over to find the correct x or y number to use -squinting and pointing with my finger as I count. I envision some sort of vertical lines or columns with numbers across the top to assist with the counting. A basic horizontal line of numbers across the top would help, but there would still be a need to figure the x,y by manually counting or doing math when the characters are in the middle of the file name. Maye the ability to drag and highlight the columns or "boxes" in a header corresponding to the characters could display the total highlighted.
Or am I missing something?
Larry Gilbert

Alien426
Posts: 7
Joined: 02.02.2016, 11:36

Re: Multi-rename character count

#2 Post by Alien426 » 23.01.2023, 11:32

Please note that I'm not the developer.

Such a feature would be quite hard to implement. You would have to set the font of the "Old name" column to a monospace font (I don't think FreeCommander XE uses any monospace font by default) so that the characters have a fixed width.
You would also have to display Unicode characters that are normally not displayed AND make sure that Unicode characters are displayed in the same width as all other characters (arabic ligature bismillah ar-rahman ar-raheem "﷽" is one character!).
Then you'd have to find the width of one character in the monospace font and draw a ruler on a standardized control (ListView?) and hope that it aligns ...
Maybe having a monospace font on a column would annoy other users, since it takes up much more space than normal fonts.

What is your use case? Where do the file names come from? Are there common parts across the file names?
I used to use the character count feature of another bulk rename tool frequently years ago, but nowadays and in FreeCommander, I find that "Search and replace" (sometimes with "Regular expression" enabled) is usually sufficient.
Maybe using Profiles could help you, if you have the same kind of files often.

lgilbert99
Posts: 9
Joined: 22.03.2019, 16:47

Re: Multi-rename character count

#3 Post by lgilbert99 » 23.01.2023, 12:34

Thanks for the reply. I kind of thought the same, that this feature would possibly just open a Pandora's Box. Here are a couple of file name examples I'm working with this week:
The_Holton_Signal_Thu__Oct_25__1923_.jpg - I rename this to "1923-10-25 The Holton Signal"
Netawaka_Chief_Thu__May_25__1916_.jpg - I rename this to "1916-05-25 Netawaka Chief"
I will Search & Replace the underscores with spaces and then Search & Replace double spaces with a single space. For the latter I would use the following "[n-4] [n,20,6] [n,-16]" which gets me close. Then I might do a Search & Replace on the month to change it to a "-05-" or I might do that manually.
I'm heavy into genealogy and am grabbing newspaper articles of ancestors. For the one person that these examples are for I have 25 files and 10 different newspapers. I have used the profiles, but there is not a consistent pattern for the newspaper names. The next person I search for will of course be in different newspapers. Thus, the length of newspaper name changes but the rest, day and date, are consistent from the same source. But next month I may be pulling files from a totally different source. As mentioned, I have setup a Profile for the newspaper filenames and I can use the same profile for all, but I must tweak the numbers for the length of the paper's name - while pointing at the screen and counting and usually trying different numbers until I hit it just right.
Was just hoping for something that could speed up the process to help me be a bit more accurate. On the other hand, I am truly grateful for what it does allow me to do, so there are no complaints.
Larry Gilbert

User avatar
ralfso
Posts: 812
Joined: 31.10.2007, 18:21
Location: Gifhorn, Germany

Re: Multi-rename character count

#4 Post by ralfso » 23.01.2023, 12:43

I also needed this function some time ogo.
I use this AutoHotkey-Script for a tooltip on ClipboardChange:

;Count Characters of Clipboard
;https://autohotkey.com/docs/commands/StringLen.htm
;https://autohotkey.com/docs/commands/On ... Change.htm

#Persistent
return

OnClipboardChange:
InputVar := Clipboard
ToolTip % "Zeichen: " . StrLen(InputVar)
Sleep 1000
ToolTip ; Turn off the tip.
return
Regards
Ralf

Win10 (64-bit), Intel i7-2600 (3,4 GHz), 8 GB Ram, 500 GB SSD, 2x2000 GB HD, NVIDIA GeForce 545

Alien426
Posts: 7
Joined: 02.02.2016, 11:36

Re: Multi-rename character count

#5 Post by Alien426 » 23.01.2023, 14:17

The month name is a problem.
Otherwise, regular expressions can help quite a bit:
In "Search for": ^(.+?)_([A-Za-z]{3})__([A-Za-z]{3})_(\d+)__(\d+)_\.jpg$
In "Replace with": $5-$3-$4 $1.jpg

Results:
"The_Holton_Signal_Thu__Oct_25__1923_.jpg" => "1923-Oct-25 The_Holton_Signal.jpg"
"Netawaka_Chief_Thu__May_25__1916_.jpg" => "1916-May-25 Netawaka_Chief.jpg"

If you can find a way to replace the month names with numbers, then you only need to do a second pass and replace the underscores with spaces (be sure to check "Replace all occurrences").

A basic primer on RegExes:
\d matches a digit character (1-9)
\w matches any alphanumeric character from the basic Latin alphabet, including the underscore
. matches any character (the dot before the file extension has to be escaped with the backslash to be regarded as a literal dot)
[] means a character class (letters uppercase A to Z, lowercase a to z)
{#} and + are quantifiers ({3} matches only if 3 characters are found, + means at least 1 {? makes it lazy, matching as few characters as possible}, the unused * means 0 or more)
The things that are matched between parentheses are captured and can be accessed with $# in the replacement text.

A simplified version of the RegEx is "(.+)_(\w+)__(\w+)_(\d+)__(\d+)_\.jpg". It still works for the examples. The double underscores help a lot and make the RegEx quite robust, I think.

There are many tutorials for regular expressions and they are very powerful.
But there is also a saying that goes like this:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

User avatar
Forez
Posts: 1312
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Multi-rename character count

#6 Post by Forez » 14.02.2023, 16:21

I also on a daily basis have this problem, although my tasks are simple ones. I deal with this by first glancing at an file or folder and guessing what number to use- and only then [after seeing wrong result in preview] counting the difference, i.e. what precised correction I need to make
ralfso wrote: 23.01.2023, 12:43 [...]
I use this AutoHotkey-Script for a tooltip on ClipboardChange:
[...]
Alien426 wrote: 23.01.2023, 14:17 [...]
there is also a saying that goes like this:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
Probably a small percent of user will invest time and energy to get acquainted with such solutions / workarounds - but on the other hand we cannot expect Marek to spend a probably huge amount of time on a feature with rather niche usability


But maybe a coarse but quite simple [thus doable] solution would be to display in some non editable three-versed table a chosen item? Something that would look like in this presentation https://uploadify.net/5f3f28e971c60566/ ... t_Tool.jpg; i.e.:

Image

This feature should:
● give users an ability to choose individual font [similar to how a font just in Address Bar can be changed]
● what sign to use when font does not possess a sign which is suppose to be used in the new named [similar to how a sign can be chosen to mark a pinned Tab]
● center in a cell all signs and numbers
● either have a fixed width for its columns, so that it would always accommodate 3 digit numbers or give users ability to decide, if they want to see labels [numbers] pass 99 thus waste precious horizontal space and deal with scrolling of screen
● be possible to be toggled between being visible and not, so that a precious vertical space could be released when counting is not needed

lgilbert99
Posts: 9
Joined: 22.03.2019, 16:47

Re: Multi-rename character count

#7 Post by lgilbert99 » 14.02.2023, 20:31

I like that idea, sort of what I was picturing in my head.
Larry Gilbert
Larry Gilbert

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests