Quote:
Originally Posted by Harris Jayaraj123
Hi All,
I have a input file like below :
-------------------------------------------------
949890;01-4477138;20101208;7003907933;0
1352305;01-32175;20101225;7005373440;0
0771586;03-975357;20091206;7004353176;0
1868963;06-26112;20101001;7004927161;0
1877828;08-300381;20101008;7004591372;0
0158942;08-371741;20100512;7011021111;0
1889407;03-282266;20101114;7025777256;0
1426078;08-53175593;20100204;7004814000;0
1805938;03-274032;20110823;7006722399;0
0993741;02-55239;20090516;7004863481;0
1981600;40-302572;20110301;7031323637;0
---------------------------------------------------
The third field in this file is date in YYYYMMDD format.
I need to get the max date(20110823) from this file and store it in a variable for doing dome calculataions.
How can i get the max date from this file using perl script ??
Thanks in advance
Regards,
Harris
|
Visit search.cpan.org and pick whatever date/time module from there - is a whole bunch; one is very good, with nice self-explanatory interface.
But, actually, date in YYYYMMDD format is lexically sortable
(see
perlfunc -f sort
).