File Rename Example

File Rename Example

foreach ( @ARGV ){

if ( /gmif1[0-9]{5}/i ){

$currentname=$_; tr/[A-Z]/[a-z]/;

s/(gmi)f1([0-9]{5})/\1\2.txt/;

}

if ( /sett[0-9]{4}/i ){

$currentname=$_; tr/[A-Z]/[a-z]/;

s/(sett)([0-9]{4})/\1\2.txt/;

}

rename ($currentname, $_);

}

Previous slide Next slide Back to the first slide View Graphic Version