Renaming help request

I have looked to find some documentation on the following but been unsuccesful as of yet, thanks for any help. :slight_smile:

I am very new to Directory Opus and still learning but there is a task I want it to be able to perform. I use a downloading program which uses external (XML) files to know what to download and the name of these files also set the name of the folder the files are downloaded into (this isn't that important). The problem is that all these files have a prefix and a special ID number as part of this, furthmore all the places where there would be a space in the folder name there is an underscore.

So I would have a folder downloaded in the following format:
msgid_7777777_Word1_Word2
I need this to become:
Word1 Word2
The number is always a 7 digit one if that's needed info, and I know how to replace the underscores with spaces and the msgid_ bit with just nothing. The underlining problem is that I cannot get the numbers removed as they are different all every folder. Now, I don't know what the best way to do it this are but I see two possible methods:

  1. The first 14 characters (taking me up to the first word) are simply trimmed off.
  2. The use of wildcards, so I could tell it to replace msgid_???????_ with nothing. I kind of get the impression this is possible but I havn't figured out how.

If either of the following (or you can think of another way) can be done please tell me as this would be vastly useful to me an a few people I know. If both are possible then please explain both as I would rather learn now then have to spend time confused in the folder.

Thanks for any help anyone can offer,
Greg

Using regular expressions,

old name: msgid_._(.)_(.*)
new name: \1 \2

Hmm... works pretty well, but as I don't understand Regular Expressions and that doesn't quite fill the need. I mean, if there was just 2 words it works fine, but this isn't always the case.

I tried just using:
msgid_._(.)
and \1 so it would show everything after the msgid_.*_ but it didn't quite work how I had planned. I don't know if this is just supposed to show the last word right of the last underscore, but the amount of words is changable...

Is it possible to have it just remove from the beginning the msgid_.*_ part?

Or maybe it is possible to have the _(.*) part at the end added on as many times as there is words? ...which can be read from the folder name?

Thank you very much for your help by the way.
Much appreciated,
Greg

RegExp Rename
From: msgid_[^]+(.+)
To: \1

The [^_]+ part will match one or more characters that are not an underscore.

Ah yes, works fine, thank you very much for your help. :smiley: