I am trying to remove any words before content inside [*]
I have multiple files to rename for example 'ABC [1].txt, ABC [2].txt, ABC [3].txt' that I need to rename to '[1].txt, [2].txt, [3].txt'
I have a few hundred items to rename and wondered if this can be done in powershell.
However I can not find any information on doing this. Does anybody have any ideas? Thanks!
This can be achieved by an easy regex replace:
Explanation of the regex used:
.*- match 0 or more of any character.(\[\d+\].*)- Capturing group capturing 1 or more digits which are enclosed in[]followed by the ext-name.$1- is the substitution string which is captured above.