Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: File Manipu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 11010 of 11520
Post > Topic >>

Re: File Manipulation ??

by peng.kyo@[EMAIL PROTECTED] (J. Peng) May 1, 2008 at 11:43 PM

On Thu, May 1, 2008 at 11:20 PM, Anderson Ramroop <ramroop@[EMAIL PROTECTED]
>
wrote:

>
> I just want to pull the latest data with the Acct number...
>
> not the whole string sorted by date?
>

Please submit the question back to the list.

For this case, codes could be:

use strict;
use Time::Local;
my @[EMAIL PROTECTED]
(<DATA>) {
    chomp;
    my ($id,$date) = split/\~/;
    if (@[EMAIL PROTECTED]
) {
        my $time_old = gettime($arr[1]);
        my $time_new = gettime($date);
        @[EMAIL PROTECTED]
 = ($id,$date) if $time_new > $time_old;
    } else {
        @[EMAIL PROTECTED]
 = ($id,$date);
    }
}

print "@[EMAIL PROTECTED]
";

sub gettime{
     my ($m,$d,$y) = split/\//,+****ft;
     return timelocal(0,0,0,$d,$m -1,$y);
}

__DATA__
155073040~06/04/1998
155073040~04/28/1998
155073040~04/29/1998
255256040~04/29/1998
255293040~05/27/1999
255322040~12/09/1999
55322040~12/08/1999
755379040~04/30/1998
755383040~04/30/1998
755412040~01/19/1999
755612040~04/19/2000
755633040~04/26/1999
755763040~06/04/1998


-- 
J. Peng - QQMail Operation Team
eMail: peng.kyo@[EMAIL PROTECTED]
 AIM: JeffHua
 




 4 Posts in Topic:
File Manipulation ??
Ramroop@[EMAIL PROTECTED]  2008-04-30 14:04:02 
Re: File Manipulation ??
noreply@[EMAIL PROTECTED]  2008-05-01 03:46:50 
Re: File Manipulation ??
peng.kyo@[EMAIL PROTECTED  2008-05-01 11:12:54 
Re: File Manipulation ??
peng.kyo@[EMAIL PROTECTED  2008-05-01 23:43:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 13:14:46 CDT 2008.