P Lerenard wrote:
>
> Hi,
Hello,
> @array = qx{egrep -n '\{' file);
> foreach $el (@array)
> {
> ($num,@other} = split(/\:/,$el);
> $thenum{$num} = $num;
> }
>
> foreach $ele (sort keys %thenum)
> {
> print"$ele\n";
> }
> except this one sort by string and not by integer, so 100 is before 99
>
thank you all
special thanks for the first 3 on the podium
Pierre
>From: "Mark Anderson" <[EMAIL PROTECTED]>
>To: "P lerenard" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>Subject: RE: sort a hash
>Date: Wed, 9 Oct 2002 13:28:40 -0700
>
thank you all
really really quik answer
Pierre
>From: Michael Fowler <[EMAIL PROTECTED]>
>To: P lerenard <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: sort a hash
>Date: Wed, 9 Oct 2002 12:33:28 -0800
>
>On Wed, Oct 09, 2002 at 08:21:27PM +, P le
On Wed, Oct 09, 2002 at 08:21:27PM +, P lerenard wrote:
> except this one sort by string and not by integer, so 100 is before 99
> Do you have an idea to sort that by interger and not by string, 99 before
> 100?
See perldoc -f sort. It has many fine examples of how to sort various types
of
thanks working fine
>From: "Wagner, David --- Senior Programmer Analyst --- WGO"
><[EMAIL PROTECTED]>
>To: 'P lerenard' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: RE: sort a hash
>Date: Wed, 9 Oct 2002 15:25:23 -0500
>
> Replace
see bottom...
-Original Message-
From: P lerenard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 1:21 PM
To: [EMAIL PROTECTED]
Subject: sort a hash
Hi,
@array = qx{egrep -n '\{' file);
foreach $el (@array)
{
($num,@other} = split(/\:/,$el);
$thenum{$n
]
Sent: Wednesday, October 09, 2002 13:21
To: [EMAIL PROTECTED]
Subject: sort a hash
Hi,
@array = qx{egrep -n '\{' file);
foreach $el (@array)
{
($num,@other} = split(/\:/,$el);
$thenum{$num} = $num;
}
foreach $ele (sort keys %thenum)
{
print"$ele\n";
}
except this one sort by str
Hi,
@array = qx{egrep -n '\{' file);
foreach $el (@array)
{
($num,@other} = split(/\:/,$el);
$thenum{$num} = $num;
}
foreach $ele (sort keys %thenum)
{
print"$ele\n";
}
except this one sort by string and not by integer, so 100 is before 99
Do you have an idea to sort that by interger and not by
r the FAQ
section. The command to run would be 'perldoc -q 'sort a hash''.
The first section is reprinted below, hope this helps.
- Chris.
Found in /usr/share/perl/5.6.1/pod/perlfaq4.pod
How do I sort a hash (optionally by value instead of key)?
Internally, hashes
uh...
@sortedkeys = sort keys %HASH;
remember that you can't keep the keys of %HASH sorted in %HASH, you need an
array for that.
> -Original Message-
> From: Michael Stearman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 02, 2002 9:19 AM
> To: [EMAIL PROTECTED]
Hi,
Does anyone know how to alphabetically sort the keys in a hash table?
Thanks,
Mike.
_
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
11 matches
Mail list logo