Relative Content

Tag Archive for filerename

I have a problem where I ran a command some weeks ago and now have files suffixed with a ~CAPITALS and would like to resolve this

I have lots of files that have a suffix appended to the file type part of its name so for example test.exe now is test.exe~ABCED102 and mypic.png is now mypic.png~0FGECDUR
The pattern is always ~ with 8 upper case characters.
What I am looking for is someone to point me in the direction of programmatically solving this problem with suggestions about the development language to use and maybe some examples starting with getting a list of all files that have this pattern at the end of its filetype.
I think if need to be a utility so run from the command line. I am on Windows.
I realise that getting a list could be done with a dir command but having it match the pattern is a complication currently beyond me.
At the moment I am faced with having to do this manually.

Batch rename file which end which ‘n’

One line on terminal works
“mv -f ‘g/q/q/X/dlWOk6u0HsKuwnh_935qCeKmwnQaAXGQgxgXqqg-0-300.jpg’$’r’ g/q/q/X/dlWOk6u0HsKuwnh_935qCeKmwnQaAXGQgxgXqqg-0-300.jpg”