use strict;
use warnings;

my @files = glob("canonicalRepresentative/*.test");
my $n = 0;
my $targetName = "3d3_nonreg";

`mkdir -p $targetName`;

foreach my $file (@files) {
   my ($folder, $no) = $file =~ m/(.*)\/(\d+)\.test/;
   my $entire = `cat $file`;
   if($entire =~ m/\/$targetName\//){
      $n++;
      print "$folder $no\n";
      `git mv $file $targetName/$no.test`;
      `git mv $folder/$no.OK $targetName/$no.OK`;
   }

}
print "There are $n files\n";
