ed3rick has asked for the wisdom of the Perl Monks concerning the following question:
i'm new to Perl and i want to rename various files on a directory with a string found on the file.
- The string that i want to use can be found on the 2nd line of each file which has a long date format (e.g. January 1, 2002, etc..).
- I want to be able to convert the string to YYYYMMDD and append it on the beginning of each file names that i want to rename.
example: abc001 will be renamed as 20020105-abc001
where abc001 is the old filename and 2002 as the year, 01 as the month and 05 as the day and append it on the beginning of the current file.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting Date to String
by choroba (Cardinal) on Jun 19, 2015 at 11:35 UTC | |
|
Re: Converting Date to String
by kcott (Archbishop) on Jun 19, 2015 at 12:12 UTC |