Re: Sorting Addresses



Michael wrote:
Hello,

I have a list of address and want to sort them so can display them in
a GUI in order of house number:

{101 Hampton Road London} {103 Hampton Road London} {105 Hampton Road
London} {107 Hampton Road London} {109 Hampton Road London} {Flat 1
113 Hampton Road London} {Flat 2 113 Hampton Road London} {Flat 3 113
Hampton Road London} {Flat 4 113 Hampton Road London} {Flat 5 113
Hampton Road London} {Flat 6 113 Hampton Road London} {115 Hampton
Road London} {117 Hampton Road London} {119 Hampton Road London} {121
Hampton Road London} {67 Hampton Road London} {69 Hampton Road London}
{69A Hampton Road London} {71 Hampton Road London} {73 Hampton Road
London} {75 Hampton Road London} {77 Hampton Road London} {79 Hampton
Road London} {81 Hampton Road London} {83 Hampton Road London} {85
Hampton Road London} {87 Hampton Road London} {89 Hampton Road London}
{91 Hampton Road London} {93 Hampton Road London} {95 Hampton Road
London} {97 Hampton Road London} {99 Hampton Road London}

I've tried lsort with the option -integer but some of the address
start with ascii or has an ascii character in the house number (e.g
69A). Before I go and write my own algorithm, is there an existing
procedure/package that I can use?

Thanks
Michael

IMHO the first thing to do is to normalise your addresses.

diseminate each of those adresses into
Town, Street, StrNo, SubNo, FlatNo
using perhaps some heuristics on how to interprete the stuff.
use {} for unassigned values.

create a list
set thisitem [ list $Town $Street $StrNo $SubId $FlatNo ]
append alladdresses $thisitem


then you can sort the $alladdresses list to your personal delight
by index and -int or whatnot.

uwe


.



Relevant Pages

  • Re: Sorting Addresses
    ... Road London} {117 Hampton Road London} {121 ... start with ascii or has an ascii character in the house number (e.g ... I enter the postcode in tk GUI (client) ...
    (comp.lang.tcl)
  • Re: Sorting Addresses
    ... Road London} {117 Hampton Road London} {121 ... start with ascii or has an ascii character in the house number (e.g ... I enter the postcode in tk GUI (client) ...
    (comp.lang.tcl)
  • Re: Sorting Addresses
    ... {101 Hampton Road London} ... I've tried lsort with the option -integer but some of the address ... start with ascii or has an ascii character in the house number (e.g ...
    (comp.lang.tcl)
  • Sorting Addresses
    ... a GUI in order of house number: ... {101 Hampton Road London} ... start with ascii or has an ascii character in the house number (e.g ...
    (comp.lang.tcl)
  • Re: Sorting Addresses
    ... {101 Hampton Road London} ... I've tried lsort with the option -integer but some of the address ... start with ascii or has an ascii character in the house number (e.g ...
    (comp.lang.tcl)