groups

Link to this snippet:


Download to Code Collector

language: Perl
licence: Other

Rename a lot of files in a directory 2

options: send to code collectorview all nepahwin's snippets
#!/usr/bin/perl -w

$dir = "fet_tuning";

opendir(DIR, "$dir/.");
@files = grep(/2./,readdir(DIR));
closedir(DIR);

foreach $file (@files) {
  $run = substr($file, 13, 4);
  system("mv $dir/$file $dir/Run$run");
}