I suggest qsort(). You will need to write your own callback procedure. In
that procedure, break the IP address up into it's components, either put
them into numeric fields or add your leading zeros, and decide which is
higher. There examples all over the web and in the archives to get you on
your way.
Brian May
Project Lead
Management Information Systems
Garan, Incorporated
Starkville, Mississippi
Young i Professionals
http://www.youngiprofessionals.com
Jon S <rvrratjon@xxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
10/22/2009 02:25 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
To
<midrange-l@xxxxxxxxxxxx>
cc
Subject
Sorting Question
I have the need to sort a file of IP addresses on a display as if they had
a leading zero. For example they want to see
192.44.208.119
192.44.208.12
192.44.208.120
to be sorted as
192.44.208.12
192.44.208.119
192.44.208.120
as if the .12 had a leading zero. This is a character field. Any
suggestions? Thanks in advance.
Jon
_________________________________________________________________
Windows 7: It helps you do more. Explore Windows 7.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3:102009
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.