Bulk Rename

Like several of the other features added to Kokua this feature is likely to only be of interest to a relatively small section of the population (content creators and scripters specifically) who will probably find it to be a major timesaver for an otherwise slow, manual and error-prone activity.

Say you sell a product which contains several scripts and use version numbers so that you and your customers can easily tell which version they have. Something a bit like this:-

When you come to do your next version all seven scripts need to go up to the next version number. Previously the only way of doing this is individual rename operations on every item. In addition there is a delay each time while the object content refreshes which can become lengthy and result in the view scrolling once there are a substantial number of items in the content. You could save some time by doing the renames within Inventory where there isn’t a refresh delay however the benefits of this tend to be outweighed by needing to keep an eye on permission changes as items enter inventory or are put back into an object.

Bulk Rename allows you do the same operation in one move. Click on the Bulk Rename button which will open a floater window that allows you to enter the pattern to match and what the pattern should be replaced with, like this:-

Notice that the search term has been entered as “1\,00” and the replace term as “1.01”. That will be explained below. Before that though, here is what happens when Apply is clicked:-

The progress area above the OK/Apply/Cancel buttons shows what has been done including each rename that was performed. If an item matched but is no-modify this will be noted and the item will not be changed.

After the rename requests have been sent the content will refresh with the new values based on their local outcome and a few moments later will refresh again when the simulator refreshes the content with the authoritative version.

The search matching is performed using regular expressions which allow you to specify quite sophisticated patterns to match. Some hints on the syntax to use are shown below the Replace field on the floater.

One that is particularly useful is $& which introduces the matched search term into the replacement value allowing you to re-use it there. This is of particular value once some of the more advanced matching features of regular expressions are being used such as sets and wildcards.

Two others worth a specific mention are ^ which anchors the search term at the start of the line and $ which anchors to the end of the line. Thus ^Script would get matches but ^ipt would not, similarly 01$ would get matches but Script$ would not.

The period ( . ) has a special meaning within regular expression syntax - it matches any single character thus in the example above \. is used - the single \ escapes the following character, ie strips it of any special meaning.

In the example above 1.00 could have been used, and would have worked, however it’s a good idea to get in the habit of knowing the special characters and escaping them with \ to avoid unexpected effects - although 1.00 as a search term will match 1.00 it would also match 1200 or 1A00 which could lead to unexpected effects.

The Rename Content floater is based closely on the Permissions floater and shares the ability to specify which types of content are operated on together with All and Clear buttons to speed up the selection process.