moving text from start to end

Post any Bulk Rename Utility support requirements here. Open to all registered users.

moving text from start to end

Postby AJ » Sat Apr 15, 2006 2:19 pm

I have 28 folders that are named:

"dd.mm.yy randomtext"

I would like to move the date from the start to the end. The date at the start is not the same as the current date, date created or date modified. The randomtext is not always the smae length.

Can this be done?

All posts/replys/help appreciated. :)
AJ
 
Posts: 3
Joined: Sat Apr 15, 2006 2:14 pm
Location: Rutland, England

Postby Admin » Sat Apr 15, 2006 7:11 pm

Hi,

This would be possible with a regular expression. I'm short of time but others can probably help.


Jim
Admin
Site Admin
 
Posts: 2350
Joined: Tue Mar 08, 2005 8:39 pm

Postby AJ » Sat Apr 15, 2006 7:15 pm

Thanks.

I'll try doing it with a regular expression.

Any help from others is really appreciated though.

AJ
AJ
 
Posts: 3
Joined: Sat Apr 15, 2006 2:14 pm
Location: Rutland, England

Postby Admin » Sat Apr 15, 2006 7:22 pm

Yeah, sorry I can't help. A death in the family this morning means I'm pretty short of time for he next week or so. This is probably my last website-check for a few days.


Jim
Admin
Site Admin
 
Posts: 2350
Joined: Tue Mar 08, 2005 8:39 pm

Postby AJ » Sun Apr 16, 2006 11:02 am

I'm sorry for your loss.

I'll work it out myself.

Thanks.

AJ
AJ
 
Posts: 3
Joined: Sat Apr 15, 2006 2:14 pm
Location: Rutland, England

Postby Stefan » Mon Apr 17, 2006 2:06 pm

Hi Jim, my 'commiseration' for you, your fiancee and your familys.



Hi AJ.

> "dd.mm.yy randomtext"
> I would like to move the date from the start to the end

There are better regex for date detection...
... but here's a simple one:

Find:
- two digits ===> \d\d
- one dot ====> \.
- two digits ===> \d\d
- one dot ====> \.
- two digits ===> \d\d
- a space ===> \s
- random text ===> .+


so we search for
\d\d\.\d\d\.\d\d\s.+
or for
\d\d\.\d\d\.\d\d .+

or for
\d+\. ===> one or more digit followed by an dot
\d+\.\d+\.\d+\s ===> two times the same as above PLUS one or more digit following ba a space


we want to (group) our search for to move this groups
so we search for (\d\d\.\d\d\.\d\d) (.+)


to the first (group) we refer later with \1
and for the second (group) we refer with \2

so our replace should be (second group)space(first group): \2 \1



in short:
search: (\d\d\.\d\d\.\d\d) (.+)
replace: \2 \1


Please take a look in the regex forum for further help... or ask again if not clear :D
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Postby Admin » Mon Apr 17, 2006 3:34 pm

Many thanks Stefan.

Note that you'll need to tick the "include extension" box, as the Reg Exp engine will see the "." in the name and assume it's an extension.

This behavior will be altered in the next release, to take account of the "ignore folder extensions" Option menu item.


Jim
Admin
Site Admin
 
Posts: 2350
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support