Perl script to change file extensions
#!/usr/bin/perl -w print("File extension that you want to change: "); chomp($badex = <STDIN>); print("File extension that you want added: "); chomp($goodex = <STDIN>); foreach $file (<*$badex>){ @fields = split(/$badex/,$file); $goodfile = ("$fields[0]" . "$goodex"); rename("$file","$goodfile"); }
No comments:
Post a Comment