Search and replace wildcard filter

Discussion, questions and support.
Post Reply
Message
Author
XMCQCX
Posts: 2
Joined: 19.12.2020, 22:20

Search and replace wildcard filter

#1 Post by XMCQCX » 19.12.2020, 22:34

Hi,
What is the code I need to rename these files:

Test 1 1920x1080
Test 2 3840x2160 (2)
Test 3 3840x2160

to

Test 1 [1920x1080]
Test 2 [3840x2160] (2)
Test 3 [3840x2160]

I think I found the right code In the search box with:
????x????

But I'm not able to find the right code in the replace box. Any help would be appreciated

XMCQCX
Posts: 2
Joined: 19.12.2020, 22:20

Re: Search and replace wildcard filter

#2 Post by XMCQCX » 20.12.2020, 01:33

"yeah I got skills" on Reddit found a solution with powershell.

Code: Select all

Get-ChildItem -LiteralPath 'C:/Path/To/Files/' -File | Rename-Item -NewName { $_ -replace '\b(\d+x\d+)\b', '[$1]' }

Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests