Try running this code from CF (obviously):

---------------code---------------

<cfset iplist =
"216.56.6.245,216.66.132.134,24.16.140.8,24.165.85.118,24.178.211.39">
<cfset newiplist = "">

<cfset num = 1>
<cfloop list="#iplist#" index="addr">
    <cfset newip = "">
    <cfloop list="#addr#" index="part" delimiters=".">
        <cfset newpart = part>
        <cfif part lt 100>
            <cfset newpart = "0" & part>
        <cfelseif part lt 10>
            <cfset newpart = "00" & part>
        </cfif>
        <cfset newip = ListAppend(newip, newpart, ".")>
    </cfloop>
    <cfset newiplist = ListAppend(newiplist, newip, ",")>
    <cfset num = num + 1>
</cfloop>

<cfloop from="1" to="#ListLen(iplist)#" index="i">
    <cfoutput>
        #ListGetAt(iplist, i)#
        :
        #ListGetAt(newiplist, i)#
    </cfoutput><br>
</cfloop>

<br><br>
<cfloop list="#ListSort(newiplist, "text")#" index="j">
    <cfoutput><b>#j#</b></cfoutput><br>
</cfloop>

---------------code---------------

Enjoy!

Paul

-----Original Message-----
From: Paris Lundis <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Date: 07 June 2001 07:53
Subject: sorting by IP addresses...


>So I am writing some log reporting for my enjoyment... well to make
>things a little easier to quantify...
>
>one thing I want to be ablt to do is ORDER queries by the value stored
>of the viewers IP ADDRESS...
>
>It doesn't work without some modification of the IP address... anyone
>worked on anything to do this right...
>
>for instance I get this in order:
>
>216.56.6.245
>216.66.132.134
>24.16.140.8
>24.165.85.118
>24.178.211.39
>
>not exactly right :)
>
>ideas please...
>
>-paris
>[finding the future in the past, passing the future in the present]
>[connecting people, places and things]
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to