Multi-rename tool: Search/replace elipsis

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DRP535
Senior Member
Senior Member
Posts: 301
Joined: 2003-03-03, 11:25 UTC

Multi-rename tool: Search/replace elipsis

Post by *DRP535 »

I am wishing to search/replace a large collection of files, some of which probably have been named with an elipsis in their name made up of a simple three consecutive full stop points. Thus: ...

What I want to do is automatically replace any such instance of ... with ALT-0133 instead: …

As it stands though, TC's own internal search routine ALT-F7 appears incapable of finding the search string ...

How can this be done automatically without having to laboriously go through ~5,000 files all arranged and organised into multiple folders and sub-folders?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, I don't have any problems finding files containing … in the name. Are you sure it's the single character ALT-0133 and not 3 separate dots?
Author of Total Commander
https://www.ghisler.com
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

What happens if you
- mark a file
- press CTRL+M (Multi-Rename Tool)
- Search for: ...
- Replace with: ALT+0133 (Place the cursor in the field "Replace with", then press ALT+0133)
- press Button "Start!"
?

If that is your desired result, then you can use "Commands" - "Branch View (With Subdirs) <Ctrl+B>":
- press CTRL+B (and wait...)
- mark all
- press CTRL+M (Multi-Rename Tool)
... Search for ... see above ...

An existing backup is advantageous despite there is a "Undo"-function in Multi-Rename Tool.
Last edited by tuska on 2017-03-15, 23:39 UTC, edited 1 time in total.
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

ghisler(Author) wrote:Strange, I don't have any problems finding files containing … in the name. Are you sure it's the single character ALT-0133 and not 3 separate dots?
ALT+F7 finds single character ALT-0133 but how could one find 3 separate dots?
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

VBScript: Char code of signs in file name ANSI ASCII UNICODE

Post by *Stefan2 »

Test script to check the code of the signs of an file name:

- save below code as ShowCharCode.vbs
- open DOS console
- execute: ShowCharCode.vbs "Test file name.ext"

For UNICODE signs to test, see e.g. http://www.ltg.ed.ac.uk/~richard/unicode-sample-3-2.html



ShowCharCode.VBS

Code: Select all

'// The script:
'===
'// http://ghisler.ch/board/viewtopic.php?p=326421#326421
If Wscript.Arguments.Count = 1 Then strString = WScript.Arguments(0)
If (strString = "") Then strString = "a A … ..."
vOUT = strString & vbLF & vbLF & "||Sign||ASCII||UNICODE||" & vbLF
For i=1 To Len(strString)
    vOUT = vOUT & "||"& Mid(strString,i,1) &"||"& Asc(Mid(strString,i,1)) &"||"& AscW(Mid(strString,i,1)) &"||" & vbLF
Next 
WScript.Echo vOUT
'===

'=========================================================================
'// Addendum:
'// Test results (for unicode chars to test with, see e.g. http://www.ltg.ed.ac.uk/~richard/unicode-sample-3-2.html)
'   C:\Temp\VBS\z.vbs
'   ---------------------------
'   Windows Script Host
'   ---------------------------
'   a A … ...
'   
'   ||Sign||ASCII||UNICODE||
'   ||a||97||97||
'   || ||32||32||
'   ||A||65||65||
'   || ||32||32||
'   ||…||133||8230||
'   || ||32||32||
'   ||.||46||46||
'   ||.||46||46||
'   ||.||46||46||
'   
'   ---------------------------
'   OK   
'   ---------------------------

'   
'   C:\Temp\VBS\z.vbs TOTALCMD.EXE
'   ---------------------------
'   Windows Script Host
'   ---------------------------
'   TOTALCMD.EXE
'   
'   ||Sign||ASCII||UNICODE||
'   ||T||84||84||
'   ||O||79||79||
'   ||T||84||84||
'   ||A||65||65||
'   ||L||76||76||
'   ||C||67||67||
'   ||M||77||77||
'   ||D||68||68||
'   ||.||46||46||
'   ||E||69||69||
'   ||X||88||88||
'   ||E||69||69||
'   
'   ---------------------------
'   OK   
'   ---------------------------
'   
'   
'   ---------------------------
'   Windows Script Host
'   ---------------------------
'   UNICODE A a A a C cD d Ð d E E G.txt
'   
'   ||Sign||ASCII||UNICODE||
'   ||U||85||85||
'   ||N||78||78||
'   ||I||73||73||
'   ||C||67||67||
'   ||O||79||79||
'   ||D||68||68||
'   ||E||69||69||
'   || ||32||32||
'   ||A||65||256||
'   || ||32||32||
'   ||a||97||257||
'   || ||32||32||
'   ||A||65||258||
'   || ||32||32||
'   ||a||97||259||
'   || ||32||32||
'   ||C||67||262||
'   || ||32||32||
'   ||c||99||263||
'   ||D||68||270||
'   || ||32||32||
'   ||d||100||271||
'   || ||32||32||
'   ||Ð||208||272||
'   || ||32||32||
'   ||d||100||273||
'   || ||32||32||
'   ||E||69||274||
'   || ||32||32||
'   ||E||69||280||
'   || ||32||32||
'   ||G||71||284||
'   ||.||46||46||
'   ||t||116||116||
'   ||x||120||120||
'   ||t||116||116||
'   
'   ---------------------------
'   OK   
'   ---------------------------
'
'   
'   ---------------------------
'   Windows Script Host
'   ---------------------------
'   UNICODE ???.txt
'   
'   ||Sign||ASCII||UNICODE||
'   ||U||85||85||
'   ||N||78||78||
'   ||I||73||73||
'   ||C||67||67||
'   ||O||79||79||
'   ||D||68||68||
'   ||E||69||69||
'   || ||32||32||
'   ||?||63||-11284||
'   ||?||63||-17416||
'   ||?||63||-19749||
'   ||.||46||46||
'   ||t||116||116||
'   ||x||120||120||
'   ||t||116||116||
'   
'   ---------------------------
'   OK   
'   ---------------------------
'


EDIT:
another example

Code: Select all

'
'   "Test file....txt"  << three + one dot
'   ---------------------------
'   Windows Script Host
'   ---------------------------
'   Test file....txt
'   
'   ||Sign||ASCII||UNICODE||
'   ||T||84||84||
'   ||e||101||101||
'   ||s||115||115||
'   ||t||116||116||
'   || ||32||32||
'   ||f||102||102||
'   ||i||105||105||
'   ||l||108||108||
'   ||e||101||101||
'   ||.||46||46||
'   ||.||46||46||
'   ||.||46||46||
'   ||.||46||46||
'   ||t||116||116||
'   ||x||120||120||
'   ||t||116||116||
'   
'   ---------------------------
'   OK   
'   ---------------------------
'   
'   "Test file..txt"    << ASCII 0133 + one dot (Alt + Num0133)
'   ---------------------------
'   Windows Script Host
'   ---------------------------
'   Test file….txt
'   
'   ||Sign||ASCII||UNICODE||
'   ||T||84||84||
'   ||e||101||101||
'   ||s||115||115||
'   ||t||116||116||
'   || ||32||32||
'   ||f||102||102||
'   ||i||105||105||
'   ||l||108||108||
'   ||e||101||101||
'   ||…||133||8230||
'   ||.||46||46||
'   ||t||116||116||
'   ||x||120||120||
'   ||t||116||116||
'   
'   ---------------------------
'   OK   
'   ---------------------------



HTH? :D
Last edited by Stefan2 on 2017-03-15, 12:01 UTC, edited 2 times in total.
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

How to find files with dot in name.

Post by *Stefan2 »

tuska wrote:
ghisler(Author) wrote:Strange, I don't have any problems finding files containing … in the name. Are you sure it's the single character ALT-0133 and not 3 separate dots?
ALT+F7 finds single character ALT-0133 but how could one find 3 separate dots?
If you search for smtg with a DOT, like '...',
TC expect you want to find the exact entered term '...'.

So search for *...* to find names which contains '...'




 
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Re: How to find files with dot in name.

Post by *tuska »

Stefan2 wrote:So search for *...* to find names which contains '...' 
Ahh, thanks!
Didn't find a hint in the help-file of TC.
User avatar
DRP535
Senior Member
Senior Member
Posts: 301
Joined: 2003-03-03, 11:25 UTC

Post by *DRP535 »

ghisler(Author) wrote:Strange, I don't have any problems finding files containing … in the name. Are you sure it's the single character ALT-0133 and not 3 separate dots?
It would appear the forum is not providing notification e-mails to me. I had no idea there were so many responses.

You've got it around the wrong way. I want to find three consecutive dot points ... and replace them with ALT-0133. I would expect that TC would have no problem with finding instances of ALT-0133, but that's not what I'm after.
User avatar
DRP535
Senior Member
Senior Member
Posts: 301
Joined: 2003-03-03, 11:25 UTC

Post by *DRP535 »

tuska wrote:What happens if you
- mark a file
- press CTRL+M (Multi-Rename Tool)
- Search for: ...
- Replace with: ALT+0133 (Place the cursor in the field "Replace with", then press ALT+0133)
- press Button "Start!"
?

If that is your desired result, then you can use "Commands" - "Branch View (With Subdirs) <Ctrl+B>":
- press CTRL+B (and wait...)
- mark all
- press CTRL+M (Multi-Rename Tool)
... Search for ... see above ...

An existing backup is advantageous despite there is a "Undo"-function in Multi-Rename Tool.
Good idea! This works, but I still don't understand why it can't be done more selectively with ALT-F7
User avatar
DRP535
Senior Member
Senior Member
Posts: 301
Joined: 2003-03-03, 11:25 UTC

Re: How to find files with dot in name.

Post by *DRP535 »

Stefan2 wrote:
tuska wrote:
ghisler(Author) wrote:Strange, I don't have any problems finding files containing … in the name. Are you sure it's the single character ALT-0133 and not 3 separate dots?
ALT+F7 finds single character ALT-0133 but how could one find 3 separate dots?
If you search for smtg with a DOT, like '...',
TC expect you want to find the exact entered term '...'.

So search for *...* to find names which contains '...'
Thank you! Brilliant, that's the answer I wanted. Works like a charm.
Post Reply