bh_perl has asked for the wisdom of the Perl Monks concerning the following question:

hi...

What is the fastest way or the best way to find yesterday file only and rename file based on file date. The output file format will be in <filename>.YYYYMMDDHHMI format. Please refer my sample as below.

As example, below is the sample input file:-

#ls -l -rw-rw-r-- 3 acec acec 722944 Jan 24 20:15 TTFILE003623 -rw-rw-r-- 3 acec acec 942080 Jan 24 21:15 TTFILE003624 -rw-rw-r-- 3 acec acec 868352 Jan 24 22:15 TTFILE003625 -rw-rw-r-- 3 acec acec 602112 Jan 24 23:15 TTFILE003626

and the result after renaming are:-

TTFILE003623.201001242015 TTFILE003624.201001242115 TTFILE003625.201001242215 TTFILE003626.201001242315

Replies are listed 'Best First'.
Re: How to find and rename file ?
by planetscape (Chancellor) on Jan 25, 2010 at 06:14 UTC
Re: How to find and rename file ?
by Anonymous Monk on Jan 25, 2010 at 05:31 UTC
    What is the fastest way or the best way

    The normal way is the only way, so it is also the best and fastest way.