Replace a blank space with text?

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

Replace a blank space with text?

Postby PeterNE1 » Tue Jan 27, 2009 4:45 pm

Anyone know how to do this please? What I need to do is be able to rename a series of folders, by replacing a designated *blank space* (usually the first one) within the existing folder-name with text. (Actually, what I want to do, specifically, is replace the first space of the existing name with ' - ' ... that is, space, dash, space. Existing names all vary, so it's not possible to 'count in' from the beginning of the name, and insert, etc.
PeterNE1
 
Posts: 3
Joined: Tue Jan 27, 2009 3:48 pm
Location: Newcastle upon Tyne, UK

Re: Replace a blank space with text?

Postby jimwillsher » Tue Jan 27, 2009 11:17 pm

Hi,

I'd probably use a RegExp. I've not tried it, but I think this will work:

Match: (.*)\s(.*)
Replace:\1 - \2



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

Re: Replace a blank space with text?

Postby PeterNE1 » Wed Jan 28, 2009 1:14 am

Hi Jim ... close, but not quite :D ... Will confess, I've no idea what you were doing, or why, so I just copied and pasted into the boxes within the software :shock: ... the result is that it ALMOST does what I want ... except it does it with the LAST blank space in the file-name, when I need it to do it in the FIRST space.
Any further help greatly appreciated.
Is there a simple explanation to what you are doing ... something a simple soul like me can get their head around? :?
Thanks!


Ahhhhh! ..... 3am and lateral thinking raises its ugly head ... I think? :shock:
1/ Select folders to rename
2/ Function (2) File: Reverse then Rename
3/ Apply your RegEx solution AND Function (2) set to Reverse again and Rename!

Clunky, but it works :shock:
Anyone have anything better (Please? :lol: )
PeterNE1
 
Posts: 3
Joined: Tue Jan 27, 2009 3:48 pm
Location: Newcastle upon Tyne, UK

Re: Replace a blank space with text?

Postby jimwillsher » Wed Jan 28, 2009 9:23 am

Ok try this:

Match: (.*?)\s(.*)
Replace:\1 - \2

Basically the same as you had before but with a ? in there


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

Re: Replace a blank space with text?

Postby PeterNE1 » Sat Jan 31, 2009 12:52 am

Many thanks Jim, works perfectly!
Much appreciated :D
PeterNE1
 
Posts: 3
Joined: Tue Jan 27, 2009 3:48 pm
Location: Newcastle upon Tyne, UK


Return to BRU Support