in reply to change number to word
1.In a file how do I change the numeric values to word excluded the date formatUse Lingua::EN::Numbers.
use Lingua::EN::Numbers qw(num2en); while (<DATA>) { s/(\d+)/num2en $1/eg; print; } __DATA__ Too Small: 7 and 5. Too Big: 123345 Just right: 51
2.How to capitalize the first letter of each word found after AU: markerAlready asked and answered in it's own thread Make the first letter of each word capitalize. Just use Lingua::EN::NameCase.
3. there's a date format Oct 27, 2011 change to YYYY/MM/DD output should be 2011/10/27 I having a problem how to change the month in numeric form first then change the format as YYYY/MM/DD.Use Date::Parse and POSIX:
use Date::Parse qw(strptime); use POSIX qw(strftime); my $str = 'Oct 27, 2011'; my $newdate = strftime "%Y/%m/%d", strptime $str; print "$newdate\n";
- Miller
|
|---|