in reply to Multiple File Rename
- Read perlintro for a refresher
- use File::Find::Rule to obtain a list of files
- use for to iterate over that list and extract caption
- use s/// to massage $Caption into an appropriate filename (no newlines, etc, etc, Regexp::English might help you compose a regex)
- combine caption with original filename ( DSC03753.JPG becomes DSC03753-NudeNodeReaper.JPG)
- DO NOT ATTEMPT RENAMING (How can I reliably rename a file?) until you're sure your caption is producing good filenames -- produce a rename script (of shell commands) first
then review it manually for mistakesrename "path/origfilename1" "path/newfilename1" rename "path/origfilename2" "path/newfilename2" ... - Similar thread and example program at Re^2: Changing filenames
- rename 0.3 - now with two extra cupholders
- Super Search or site:perlmonks.org rename file
- site:perlmonks.org unicode filename Win32::Unicode
|
---|
In Section
Seekers of Perl Wisdom