|
Posted by RedGrittyBrick on June 8, 2008, 8:26 am
Please log in for more thread options
robertchen117@gmail.com wrote:
> I have many html files in my directory, I want to change all date with
> dd/mm/yy format to /mm/dd/yyyy in the files.
>
> Please let me know how to do it in perl...
>
> thanks
On Unix something like
perl -p -i -e 's|(\d\d)/(\d\d)/(\d\d)|"$2/$1/".($3<50?20:19).$3|eg' \ *.html
As I expect you know, on MS Windows you have to use -e'' instead of -e""
which means I usually change the inner "foo" to qq(foo).
--
RGB
|