in reply to Re^4: Removing characters in a file name
in thread Removing characters in a file name

for my $file ( <*.mp4> ) { if ( $file =~ /-\s*(\d+)\s*-/ ) { rename $file, "[Books] $1.mp4" or die "Cannot rename '$file' b +ecause: $!"; } }

Replies are listed 'Best First'.
Re^6: Removing characters in a file name
by andy2020 (Initiate) on Apr 23, 2020 at 03:28 UTC

    Thanks a lot. It's working now