Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: Rename Windows files with Unicode chars

by mnooning (Beadle)
on Aug 27, 2016 at 20:23 UTC ( [id://1170595]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Rename Windows files with Unicode chars
in thread Rename Windows files with Unicode chars

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

  • Comment on Re^4: Rename Windows files with Unicode chars

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-18 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found