PS2 Script needed

Berion

Developer
Hello,
Anyone here is good in regex? I need script (whatever it would be, *.bat, *.ps, *.sh) which:
1. reading all files in dir and changing filenames
2. from "<game title> (SCES-12345).png" to "SCES_123.45.png"

Game ID is always closed in "()". And sometimes looks like this: "(SCES-12345P)" or "(SCES-12345 C)".


I would want to convert this https://www.psx-place.com/threads/hq-disc-case-covers.26545/ to OPL friendly format. I've already dealt with batch conversion to cutting covers alone without disc case, resize and put it stretched on power of two bitmap. Yet changing hundreds of filenames manually would kill me. ;p
 
@GDX I'm open to any propositions. ^^

@dazzaXx The program or script, doesn't matter. My problem is to design regular expression which would cover up my needs which I described in first post. My brain isn't good with designing algorithms so I do not know how to tell app/script to look only xxxx-yyyyy right after "(" and change it to "xxxx_yyy.yy".
 
@Berion Here is a VBScript if you use Windows. Just need to edit the path in the first line, save and double click the vbs file.

The path are scans the subdirectories recursively.
 

Attachments

Last edited:
I'm back.

@aldostools solution works great in all cases, and also recursively. Thank You! On first I've changed path to "%HOMEPATH%\Desktop\covers" but it reject it, only full path was accepted. Why?

@GDX solution also works but only in current dir, yet doesn't handle cases like "Skyscraper (SLES-55152 C).png" which turned into "C.png". Still big thank You for Your time and effort! Does it possible to convert it to be pure *.sh? I can delete busybox, replace 'del' by 'rm', 'dir' by 'ls' but what to do with 'call' and batches invoking?
 
Last edited:
  • Like
Reactions: TnA

Similar threads

Back
Top