more useful options | |
PerlMonks |
Re^4: Rename Windows files with Unicode charsby mnooning (Beadle) |
on Aug 27, 2016 at 20:23 UTC ( [id://1170595]=note: print w/replies, xml ) | Need Help?? |
I needed to have the file name as read by listDir to be what is used during the renaming. To test if the concept worked I stripped the directory of all but your script. I then created two globals, $global_file_name and $new_name. Your code created I-unicode heart-Perl. When listDir read in the file name I saved it in $global_file_name. Just prior to the rename I saved $global_file_name into $new_name. Just before the rename line I did $new_name =~ s![^:ascii:]!!ig; I then changed the rename line to rename $global_file_name, $new_name; It worked. I now know I can use this concept to strip out the unicode from a large number of files. Thank you very much for your help
In Section
Seekers of Perl Wisdom
|
|