#
#  replaces "K-" with "k-" at beginning of filename
#  writes DOS-Batch to rename file's oldname to newname
#  060329

my ( $oldname, $partname, $newname, $dirfile ) ;

$dirfile = "dir.txt" ;
system( "dir /b /ong > $dirfile" ) ;
open( DF, "<$dirfile") or die "no $dirfile\n" ;
while(<DF>) {
   chomp;
   $oldname = $_ ;
   if ( $oldname !~ /^K-(.*)/ )  { next; } 
   $partname = $1 ;
   print "ren \"$oldname\" \"k-$partname\"\n"; 
}
close $dirfile ;
unlink $dirfile ;
