allison has asked for the wisdom of the Perl Monks concerning the following question:
1.In a file how do I change the numeric values to word excluded the date format
example 11/12/2009 1 and 2 is done output 11/12/2009 one and two is done
I'll tried to look in the file for the each numeric appears and assign it but still also change the date format
2.How to capitalize the first letter of each word found after AU: marker
sample AU: mark bautista output should be AU: Mark Bautista
my $filename = "input.txt"; open my $file, '<', $filename; @fileinput=<$file>; close($file); foreach $line(@fileinput) { my $Cword=($line); if($Cword=s/(^AU:\s[a-z +]\s\[a-z])/(^AU:\s[A-Z]\s[A-Z])/g) { print $Cword; }
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.
but still output the word "Oct" it must be '10' thanksforeach $line(@fileinput) {my $testdate=($line); if($testdate =~s/(\w{3})\s(\d{2})\,\s(\d{4})/$3\/$1\/$2/) { print $tes +tdate;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: change number to word
by ww (Archbishop) on Mar 20, 2011 at 11:37 UTC | |
|
Re: change number to word
by wind (Priest) on Mar 20, 2011 at 16:24 UTC | |
|
Re: change number to word
by Anonymous Monk on Mar 20, 2011 at 06:51 UTC |