This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mass renaming tool replaces file extension dot

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC7.5x(a) final bug reports (English) Printable version
View previous topic :: View next topic  
Author Message
ThiefMaster
Junior Member
Junior Member


Joined: 27 Oct 2003
Posts: 78

PostPosted: Fri Apr 16, 2010 2:52 am    Post subject: Mass renaming tool replaces file extension dot Reply with quote

When replacing '.' with something else in the mass renamer, the dot separating name and extension is replaced, too.
However, since filename and extension are handled separately in the tool, there should be an option to disable touching of that dot.

For example, certain files usually have dots in the filename instead of spaces. When removing those dots I have to do it like that right now:
- replace . with a space
- remove the last 4 chars (space + extension)
- rename the file to [N] with extension <old-extension>
So I need to run three mass-renames even though I just want to get rid of dots in the filename...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7861
Location: Russian Federation

PostPosted: Fri Apr 16, 2010 3:14 am    Post subject: Reply with quote

I may suggest to use two-step rename. Instructions:
1. Fill name field as you wush.
2. Fill extension field as you wish but add some unique prefix like ^DOT^ (e.g. ^DOT^[E]).
3. Fill 'replace what' and 'replace with' fields as you wish.
4. Append to 'replace what' field following:
Code:
|^DOT^

5. Append to 'replace with' field following:
Code:
|.


So, TC will replace your dots with something useful for you and then will replace ^DOT^ before extension with dot. Smile

E.g. if you wish to replace dots with spaces, use:
Name:
Code:
[N]

Ext:
Code:
^DOT^[E]

Replace what:
Code:
.| ^DOT^

Replace with:
Code:
 |.

And don't forget to save this crazy preset. Wink
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…


Last edited by MVV on Fri Apr 16, 2010 3:22 am; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
ThiefMaster
Junior Member
Junior Member


Joined: 27 Oct 2003
Posts: 78

PostPosted: Fri Apr 16, 2010 3:19 am    Post subject: Reply with quote

Good idea, but being able to do it without such tricks would be better. Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7861
Location: Russian Federation

PostPosted: Fri Apr 16, 2010 3:21 am    Post subject: Reply with quote

I think it is easier to use such trick than to modify code so this will work w/o such tricks. Who knows, maybe some people like current behaviour.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Rekrul
Junior Member
Junior Member


Joined: 04 Nov 2007
Posts: 17

PostPosted: Thu Jul 29, 2010 2:42 am    Post subject: Re: Mass renaming tool replaces file extension dot Reply with quote

ThiefMaster wrote:
When replacing '.' with something else in the mass renamer, the dot separating name and extension is replaced, too.
However, since filename and extension are handled separately in the tool, there should be an option to disable touching of that dot.

For example, certain files usually have dots in the filename instead of spaces. When removing those dots I have to do it like that right now:
- replace . with a space
- remove the last 4 chars (space + extension)
- rename the file to [N] with extension <old-extension>
So I need to run three mass-renames even though I just want to get rid of dots in the filename...


Here you go, one-step renaming of "." while leaving the final period and extension in place.

In the rename mask box, put the following;

Code:
[N]^^[E]


Erase the contents of the Extension box.

In the search for box, put this;

Code:
.|^^


In the replace box, put this;

Code:
 |.


(Note that there's a space before the line)

Feel free to change "^^" to the pattern of your choice.

Presto! All periods will be changed to spaces, except the last one.

Why this works;

TC treats the extension as a separate part of the filename. When something is placed in the extension box, TC is hardcoded to place those characters after the filename separated by a period, and that period is then subjected to the search & replace rules. By erasing the contents of the extension box, you're telling TC that you don't want an extension. When you place the "[E]" tag in the filename box, it simply becomes part of the filename. You can then replace "^^" with a period, because the periods in the filename have already been changed. This happens because the search is carried out left to right. Note that if you reversed the contents of the search & replace boxes to replace the "^^" first, you'd end up with the same problem as you originally had. But by replacing it second, there's no problem changing it to a period. Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC7.5x(a) final bug reports (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group