Re: sorting?
- From: chandru.chk@xxxxxxxxx (Chandru)
- Date: Tue, 30 May 2006 15:09:29 +0530
Hi
$ cat data
"chandru k" <chk@xxxxxxxxxx>
"prg " <prm@xxxxxxx>
"chandru k" <chjk@xxx>
$ cat script.pl
#!/usr/bin/perl
while(<>)
{
chomp;
($mail,$name)=split(/\t/,reverse($_),2);
$ha{reverse($mail)}=reverse($name);
}
foreach $k(sort values(%ha))
{
print "$k\n";
}
$ ./script.pl data
"chandru k"
"chandru k"
"prg "
Regards,
Chandru
Beast wrote:
Hi,.
I have some rather big chunk of data, returned from ldap server. The format is simple:
"Displa name" <email@xxxxxxxx>
Simply displying data "as is" is simple, but how do I sorted by "display name"?
pls note that "display name" contains space and might not unique so I can't put it on %hash.
many thanks.
- References:
- sorting?
- From: Beast
- sorting?
- Prev by Date: Re: sorting?
- Next by Date: Re: Russian character support
- Previous by thread: Re: sorting?
- Next by thread: Re: sorting?
- Index(es):