Copying a string of characters and moving it to another spot

A swapping-ground for Regular Expression syntax

Copying a string of characters and moving it to another spot

Postby Crispy93 » Sat Feb 10, 2024 8:21 pm

Hi there!
I have a bunch of files named like this "ALL-PRAEXXX_PCAP_2022_31.12.2022_PRAE - Capital account al 31.12.2022" where "XXX" stands for different numbers (001, 002, 003 and so on). I'd like to copy those three digits after the second "PRAE" at the end of the name so it would end up looking like this "ALL-PRAEXXX_PCAP_2022_31.12.2022_PRAEXXX - Capital account al 31.12.2022". I've been trying to figure it out but I've discoverd BRU only recently.
Any kind soul in here that can help me? Thank you!
Crispy93
 
Posts: 2
Joined: Sat Feb 10, 2024 11:00 am

Re: Copying a string of characters and moving it to another spot

Postby Admin » Sun Feb 11, 2024 5:18 am

Use Regex (1)
Enable Simple flag

Match: ALL-PRAE%1_%2 - %3
Replace: ALL-PRAE%1_%2%1 - %3
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: Copying a string of characters and moving it to another spot

Postby Crispy93 » Mon Feb 12, 2024 9:05 am

Thank you!
Crispy93
 
Posts: 2
Joined: Sat Feb 10, 2024 11:00 am


Return to Regular Expressions


cron