| have time a .csv File (42702 Entries) to aMEGA - .json - File konvertiert.
 of these small Program can The Entries
 the jeweiliges Bezirks reading. with one Click on The
 Listbox with the Bezirken go in the GridBOX
 The suitable Bundesstaaten with the Zipcode
 displayed.
 
 Declare String File, districts, decompose, item
Declare lever btn1, grid, lb
Declare Long end, js ,xs
districts = "NH,NY,PR,VI,MA,RI,ME,VT,CT,NJ,AE,PA,DE,DC,VA,MD,WV,NC,SC,\
GA,FL,AA,AL,TN,MS,KY,OH,IN,MI,IA,WI,MN,SD,ND,MT,IL,MO,KS,NE,LA,AR,OK,\
TX,CO,WY,ID,UT,AZ,NM,NV,CA,AP,HI,AS,GU,PW,FM,MP,MH,OR,WA,AK"
decompose = "Bezirk;0;60;Bundes-Staat;0;120;Zip-Code;0;100"
end = 0
File = "F:\ZipCodes.Json"' ***************** PFAD ANPASSEN ***************************
Window Title "US-ZipCodes (Postleitzahlen) USA"
Window 600, 400
btn1 = Create("Button",  %HWnd, "Ende", 10, 10, 60, 25)
grid = Create("GridBox", %HWnd, decompose, 0, 10, 50, 300, 200)
Create("Text", %HWnd, "vorhandene Bezirke", 400, 25, 140, 25)
lb   = Create("Listbox", %HWnd, 1, 400, 50, 60, 200)
InitListbox()
If FileExists(File)
    js = Create("Json", File)
Else
    MessageBox("Keine File ZipCodes.Json vorhanden", "Fehler", 0)
    End
EndIf
WhileNot end
    WaitInput
    If Clicked(btn1)
        end = 1
    ElseIf Clicked(lb)
        item = GetString$(lb, GetCurSel(lb))
        If item <> ""
            Search(item)
        EndIf
    EndIf
EndWhile
Proc InitListbox
    ClearList
    Move("StrToList", districts, ",")
    Move("ListToHandle", lb)
ENDPROC
Proc Search
    Parameters String item
    Declare Hash entry[], String Schluessel, worth, Long i
    WhileLoop 0, Json("Count", js) - 1
        If Json("Name", js, &LOOP) = item
            xs = Json("GetObject", js, item)
            entry[] = Json("Hash", xs)
            ClearList grid
            ForEach entry[], Schluessel, worth
            AddStrings(grid, item + "|" + worth + "|" + Schluessel)
            EndFor
            Break
        EndIf
    EndWhile
ENDPROC
End
is Yes amazing, How quick JSON there's.
 Please Dateipfad properly Change.
 |