Cmdline Utility - Remove all characters after hyphen

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

Cmdline Utility - Remove all characters after hyphen

Postby Stbluesrul » Mon Jul 30, 2012 7:06 am

I have a directory that is full of folders that are named like so: (names are just an example, actual will be different)

Folder1-whatever
Folder2-whatever
Folder3-whatever
Folder4-whatever

I was hoping to use the command line utility to rename these to:

Folder1
Folder2
Folder3
Folder4

Folder* and "whatever" will always be different lengths. Basically, I'm just looking to chop of the "-" and everything after that. Is the command line utility capable of doing that? I've been looking at the manual and I'm not sure I see a way to do that.

Thanks.
Stbluesrul
 
Posts: 1
Joined: Mon Jul 30, 2012 2:14 am

BRC Remove hyphen and remaining text

Postby truth » Thu Jul 10, 2014 2:13 pm

Remove all text starting with final-hyphen:
brc32 /nofiles /regexp:(.+)-.*:\1
a-b-c-d -> a-b-c

Remove all text starting with 1st-hyphen:
brc32 /nofiles /regexp:(.+?)-.*:\1
a-b-c-d -> a
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRU Support