How to rename files with multile dots(.)

A swapping-ground for Regular Expression syntax

How to rename files with multile dots(.)

Postby chiahuachang » Tue Dec 09, 2008 8:29 am

Dear All,

I am trying to rename files with multiple continuous dots(.) into with only one dot.


Example:
aaa....txt --> aaa.txt
aaa...bbb...ccc..txt ---> aaa.bbb.ccc.txt

I have tried this
replace *[\.]*
with *\.*

but not work when the extension symbol is part of those multiple continuous dots(.)



Thanks
Charles
chiahuachang
 
Posts: 2
Joined: Tue Dec 09, 2008 8:16 am

Re: How to rename files with multile dots(.)

Postby jimwillsher » Tue Dec 09, 2008 10:17 am

I'd probably just choose to replace .. with . and make several passes through. Clunky, but does the job.


Jim
jimwillsher
 
Posts: 63
Joined: Wed Sep 24, 2008 1:22 pm

Re: How to rename files with multile dots(.)

Postby chiahuachang » Wed Dec 10, 2008 2:43 am

OK I got a conclusion:

1. In RegEx (1)
with thess setup
Match: *[\.]* & Replace: *\.*
will not replace "......." with "."
it will result each single pair ".." with "."
so, it needs 3 times to convert aaaa......txt to aaaa.txt

Is it a bug?

2. The [Ignore File Extension] must be checked
otherwise, aaaa..txt is not changed to aaaa.txt


Charles
chiahuachang
 
Posts: 2
Joined: Tue Dec 09, 2008 8:16 am

Re: How to rename files with multile dots(.)

Postby Glenn » Thu Dec 11, 2008 1:33 am

It's not a bug. Bulk Rename regex needs a global replace option for it to do all the replaces in one pass. This feature has not been implemented
Glenn
 
Posts: 28
Joined: Fri Apr 14, 2006 4:53 pm
Location: Winnipeg, Canada


Return to Regular Expressions