Hello,
I have a file that is As2'd to me named BC090602.txt. Every week the numbers in the file name change. So next week the file will be named BC090603.txt. How can I change my script to look for the BC characters then change orginal filename to just BC.txt no matter what the numbers are? Can I use wild characters?
I have a file that is As2'd to me named BC090602.txt. Every week the numbers in the file name change. So next week the file will be named BC090603.txt. How can I change my script to look for the BC characters then change orginal filename to just BC.txt no matter what the numbers are? Can I use wild characters?
Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
rename("BC090602.txt", "BC.txt") || print "Unable to change name.<br><br>";
print "Done";
exit;