mirror of
https://github.com/clechasseur/pathcopycopy.git
synced 2026-04-25 12:15:58 +03:00
[GH-ISSUE #76] New custom command option: remove file extension #75
Labels
No labels
bug
duplicate
enhancement
enhancement
enhancement
fixed
help wanted
help wanted
invalid
pull-request
question
waiting for input
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pathcopycopy#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Jack1789 on GitHub (Aug 25, 2019).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/76
Originally assigned to: @clechasseur on GitHub.
Hi, it would be useful if an extra base command could be added to your program, one which drops the extensions. So, something like this:
"PATHCO~1.EXE"
"PathCopyCopySettings.exe"
Turns into something like this:
"PATHCO~1"
"PathCopyCopySettings"
I'm currently using a customized command, which implements an additional regex expression to reach the desired result:
But I would like to further customize it, so it replaces every dot it finds with spaces, like this:
"PathCopyCopySettings.2019.test.exe"
"PathCopyCopySettings 2019 test"
I don't know how to get the right regex for that, but if there were an extra base command which already drops the filenames' extension, I could simply use the "find / replace" option to modify it.
Thanks.
Edit: Fixed the "...one which don't drops..." typo.
Edit 2: Fixed the regex expression since the site wasn't displaying it correctly.
@clechasseur commented on GitHub (Aug 25, 2019):
I don't think a new base command would work because it would essentially mean duplicating something - but a new custom command option makes sense.
@blackcrack commented on GitHub (Aug 25, 2019):
if, then let copy the name like it is, with points and the user can remove the points, because, then stay's original.. "copy the name, without extension"
This let you stay on the way.. if it's take the "originnal.file.name" .ext
or if the name "the orginal file name.ext" so "the orginal file name"
best regards
blacky
edit:
btw:
but don't forget sambapath's //network/path
@clechasseur commented on GitHub (Aug 25, 2019):
Thanks for the tips. I won't spawn a command prompt just to extract path without extension however, since it can be done via regex already. And I will take care of supporting forward slashes in paths, yes. 😀
@clechasseur commented on GitHub (Aug 25, 2019):
Implemented in next version (17.0).
@blackcrack commented on GitHub (Aug 26, 2019):
@clechasseur
i be at moment playing around to make a win7 update dvd,
if you whant a look : http://www.blackysgate.de/files/folder-root/batch-files/
@Jack1789 commented on GitHub (Aug 26, 2019):
Hi, I didn't get the "duplicating something" part of your answer, since as far as I know, there is no base commands that do that already present. By the way, would you please tell me what to add to the next regex expression, so it replaces dots with spaces:
So I can just add a new custom command.
Thanks.
@clechasseur commented on GitHub (Aug 26, 2019):
Replacing dots with spaces wouldn't even require a regular expression, I think. Simply perform a find for
.and replace with.@blackcrack commented on GitHub (Aug 26, 2019):
hmm.. and if the user want the point in the name ?
i have a couples file who have a point vor versioning.. filesx.3.2.5.zip
this removing of the points should be optional... in any case ...
best regards
Blacky
@clechasseur commented on GitHub (Aug 26, 2019):
@blackcrack Not sure what you mean - I was answering @Jack1789 , so the comments about replacing dots were for his own personal use - they are not part of the Path Copy Copy product.
As for the new option, it will only remove the last dot which is part of the file extension. In your example, you would end up with
filesx.3.2.5.@blackcrack commented on GitHub (Aug 26, 2019):
oh for personal use.. had not seen th whole posts.. my fault..
sorry :)
the last dot is clear,, infront of the extension ..
best :)
@Jack1789 commented on GitHub (Aug 26, 2019):
The thing is, I'm already "occupying" the find/replace option with that regex I mentioned before, which drops extensions from filenames. So, I'm wondering how to further tweak that regex expression, so it also do the dots per spaces replacing.
@clechasseur commented on GitHub (Aug 27, 2019):
Unfortunately, I'm not sure it's possible to do both in a single regular expression. You have two solutions:
That last one is possible because under the hood, custom commands use a pipeline of elements that modify the path, and it's possible to have an arbitrary number of elements in any order. The Settings application does not let you do this, but you can craft it manually.
If you want some help, export your custom command and attach the
.eccfile here, I'll try to show you how to craft a custom command doing what you want.@Jack1789 commented on GitHub (Aug 27, 2019):
OK, I bet in the next v17 version I will just use the new command which drops extension, and use the "find/replace" option to replace dot per spaces, but meanwhile, here I leave you the .ecc file:
Filename.Without.Extension.zip
If there was the chance of combining multiple "find/replace" wildcards commands into the respective fields, I would simply use one for the extension's deletion, and another one for the dots replacing (maybe comma separated values); moreover, that would let me skip having to deal with regular expressions, which is painfully difficult to learn, at least to me.
Thanks.
@clechasseur commented on GitHub (Sep 1, 2019):
@Jack1789 Try this:
Filename.Without.Extension.Or.Dots.zip
It should work as you want. Note however that you will no longer be able to edit the custom command using the Settings application; doing so will break the new find/replace element.
@Jack1789 commented on GitHub (Sep 1, 2019):
It works fine, thanks.