Re: sort a hash

2002-10-09 Thread John W. Krahn
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 >

thanks RE: sort a hash

2002-10-09 Thread P lerenard
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 >

Thanks Re: sort a hash

2002-10-09 Thread P lerenard
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

Re: sort a hash

2002-10-09 Thread Michael Fowler
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

RE: sort a hash

2002-10-09 Thread P lerenard
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

RE: sort a hash

2002-10-09 Thread Mark Anderson
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

RE: sort a hash

2002-10-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
] 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

sort a hash

2002-10-09 Thread P lerenard
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

Re: Sort a hash table

2002-04-02 Thread Chris Ball
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

RE: Sort a hash table

2002-04-02 Thread Nikola Janceski
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]

Sort a hash table

2002-04-02 Thread Michael Stearman
Hi, Does anyone know how to alphabetically sort the keys in a hash table? Thanks, Mike. _ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit