Multi Rename Tool - changing the dots into spaces

English support forum

Moderators: Hacker, petermad, Stefan2, white

ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Multi Rename Tool - changing the dots into spaces

Post by *ymmv »

How do I change file names from "Filename.Divided.Into.Multiple.Bits.v1.80.plus.nonsense" to "Filename Divided Into Multiple Bits v1.80" with the multi rename tool in just one go? At the moment I'm either renaming all files by hand, or changing the dots into spaces and then correcting the errors but I suspect this could be done with a clever reg expr statement that will only turn dots into spaces in certain instances and remove particular phrases. Can this be actually done?
Last edited by ymmv on 2005-01-24, 20:03 UTC, edited 1 time in total.
User avatar
ZAQ
Junior Member
Junior Member
Posts: 6
Joined: 2005-01-22, 10:55 UTC
Location: The Netherlands

Post by *ZAQ »

It's not in one go, but better than one by one:

Search and Replace '.' -> ' '

Search and Replace 'v1 80' -> 'v1.80'
Junior Member my ass!
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

ZAQ wrote:Search and Replace 'v1 80' -> 'v1.80'
This is probably not global to all files in the list.
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
szlori
Senior Member
Senior Member
Posts: 263
Joined: 2005-01-17, 07:12 UTC
Location: Sydney

Re: Multi Rename Tool - How do I do this question

Post by *szlori »

ymmv wrote:How do I change file names from "Filename.Divided.Into.Multiple.Bits.v1.80.plus.nonsense" to "Filename Divided Into Multiple Bits v1.80" with the multi rename tool in just one go? At the moment I'm either renaming all files by hand, or changing the dots into spaces and then correcting the errors but I suspect this could be done with a clever reg expr statement that will only turn dots into spaces in certain instances and remove particular phrases. Can this be actually done?
In the generic case, as far as my regular expression knowledge goes, it is not possible.
I mean, I tried to come up with some regular expression that would solve this, but I failed. :oops:
Conceptually it is easy: you have to match all dots that follow something else than the sequence "v\d" ("v" followed by digit, maybe v can be uppercase as well) and replace them by space.
Unfortunately I don't know if this is possible with regular expressions.
If somebody is a regexp guru, it would be very instructive to post a solution to this (if it's solvable).
User avatar
solid
Power Member
Power Member
Posts: 749
Joined: 2004-08-09, 11:20 UTC

Re: Multi Rename Tool - How do I do this question

Post by *solid »

szlori wrote:
ymmv wrote:How do I change file names from "Filename.Divided.Into.Multiple.Bits.v1.80.plus.nonsense" to "Filename Divided Into Multiple Bits v1.80" with the multi rename tool in just one go?
In the generic case, as far as my regular expression knowledge goes, it is not possible.
I mean, I tried to come up with some regular expression that would solve this, but I failed. :oops:
Conceptually it is easy: you have to match all dots that follow something else than the sequence "v\d" ("v" followed by digit, maybe v can be uppercase as well) and replace them by space.
Unfortunately I don't know if this is possible with regular expressions.
If somebody is a regexp guru, it would be very instructive to post a solution to this (if it's solvable).
search for
\.\D
replace with
$1

note that there is an empty space before the $1!!!

and regex checked

What it does, it matches every dot not followed by a number (i.e. every dot followed by any character except a number)
Then replaces the dot and the character which is not a number with a space and the same character.

The problem is that also removes the dot before the extension, so the proper extension is lost. I'm not aware of a way to do search/replace on a filename only, without extension
User avatar
szlori
Senior Member
Senior Member
Posts: 263
Joined: 2005-01-17, 07:12 UTC
Location: Sydney

Re: Multi Rename Tool - How do I do this question

Post by *szlori »

What it does, it matches every dot not followed by a number (i.e. every dot followed by any character except a number)
Then replaces the dot and the character which is not a number with a space and the same character.

The problem is that also removes the dot before the extension, so the proper extension is lost. I'm not aware of a way to do search/replace on a filename only, without extension
Well, there you go. If you put the problem in different (easier) way in words, the solution could be much simpler! :wink:
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

2ymmv
Easy - Mark your files - Enter the MultiRename Tool and Enter the following:
Search For: ".| plus nonsense"
Replace By " |"
(without "")

Because Thanks To tcv6.50 you can now search
and replace for as many things as u like in one
step - Just remember to devide them with "|"
(without "")
Hoecker sie sind raus!
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Post by *ymmv »

Hi Sir_SiLvA.

Thanks for thinking along with me. Unfortunately your solution also removes the dots of the version number, so I'd end up with somethinng like "Filename Divided into Multiple Bits v 1 80".

It's too bad you can't chain rename commands in TC, that would have solved it a lot quicker I'd guess.
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Post by *ymmv »

Hi Solid,

I tried your solution too but that would leave me with "Filename ivided nto ultiple its 1.80 lus"
User avatar
Josh
Junior Member
Junior Member
Posts: 8
Joined: 2003-08-04, 14:28 UTC
Location: Blumenau, SC
Contact:

Post by *Josh »

I think you can do that in 2 ways:

1st: replace "\.(\D)" with " $1"

then

2nd: replace " ([a-z]+$)" with ".$1"

Important: without the quotes!
User avatar
solid
Power Member
Power Member
Posts: 749
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

ymmv wrote:Hi Solid,

I tried your solution too but that would leave me with "Filename ivided nto ultiple its 1.80 lus"
Did you put $1 after the space in the replace box?
After searching for "\.(\D)" and replacing it with " $1", the result is:
Filename Divided Into Multiple Bits v1.80 plus nonsense

if you put an extra dot in the extension field
".[E]"
you will end up with
Filename Divided Into Multiple Bits v1.80 plus .nonsense
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ymmv wrote:Hi Sir_SiLvA.

Thanks for thinking along with me. Unfortunately your solution also removes the dots of the version number, so I'd end up with somethinng like "Filename Divided into Multiple Bits v 1 80".

It's too bad you can't chain rename commands in TC, that would have solved it a lot quicker I'd guess.
Sorry i have forgotten that than you have it to do thios way:

Search For: ".| plus nonsense|v1 "
Replace By " ||v1."
Hoecker sie sind raus!
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Last edited by white on 2005-02-01, 19:04 UTC, edited 3 times in total.
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Post by *ymmv »

Thanks for the suggestions so far! I've now settled on a two-pronged attack. First

"\.(\D)|(PHRASE1|PHRASE2|PHRASE3|ETC)" and " $1"

Then F5 and F2 to select the next search and replace command

" " (two spaces) and "."

That seems to work fine so far. I haven't yet experimented with White's suggestion, I'll check that out tomorrow. 8)
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

2ymmv
ymmv wrote:I haven't yet experimented with White's suggestion, I'll check that out tomorrow. 8)
Any luck yet?
Post Reply