Search and Replace help

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
hogwilson
Posts: 1
Joined: 10 Aug 2015 04:49

Search and Replace help

Post by hogwilson »

Using search and replace, how do I change file name "The.end.of.trail.com" to

"End Of The Trail.com"

Results would be remove The, all periods to spaces, case changed to title. This would work the same on any file name I night lite (select).

Your help would be greatly appreciated. Larry (registered owner)

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Search and Replace help

Post by highend »

Not possible with a single search and replace.
You need a script to do this, like:

For files only:

Code: Select all

    foreach($file, "<get SelectedItemsPathNames |>") {
        $baseName = regexmatches(getpathcomponent($file, "file"), "^.*(?=\.)");
        $ext      = getpathcomponent($file, "ext");

        $baseName = recase(replacelist($baseName, "the.|.", "| ", "|"), "t");
        renameitem("$baseName.$ext", $file);
    }
One of my scripts helped you out? Please donate via Paypal

Post Reply