In reply to G0LGS:
45000 rows of information to read and store in an Array in memory, for my
little program is a bit too much.
Are you using the wrong language? Here is the whole summit list read into memory and searchable on the the summit reference. Uses <8MB of memory including 5.5MB of data and that includes all the runtime etc. That reads the whole file into memory before constructing a dictionary keyed on the summit ref. So it probably peaked at 12MB before garbage collecting.
summitinfo = {}
def loadsummits():
.file = open(“summitslist.csv”, “r”)
.for lines in file:
…summitline = lines.strip().split(‘,’)
…summit = summitline[0]
…summitinfo summit ] = summitline[1:]
.return
print “poor mans database!”
loadsummits()
print “GM/SS-001\n”, summitinfo’GM/SS-001’]
print “OE/SB-215\n”, summitinfo’OE/SB-215’]
print “G/LD-057\n”, summitinfo’G/LD-057’]
Here’s it running with the time taken to load all the data and then find 3 summits. PC is 5yr old 3GHz Pentium 4 with 1GB of memory.
[andys@gb50linux01 ~]$ time ./filer.py
poor mans database!
GM/SS-001
‘Scotland’, ‘Southern Scotland’, ‘Ben More’, ‘1174’, ‘3852’, ‘NN 432244’, ‘’, ‘-4.5414’, ‘56.3858’, ‘10’, ‘3’, ‘01/07/2002’, ‘31/12/2099’, ‘18’, ‘29/06/2010’, ‘GM7PKT/P’, ‘’]
OE/SB-215
‘Austria’, ‘Salzburg’, ‘Weidschober’, ‘1789’, ‘5869’, ‘13.9297’, ‘47.1703’, ‘13.9297’, ‘47.1703’, ‘6’, ‘3’, ‘01/01/2008’, ‘31/12/2099’, ‘0’, ‘’, ‘’, ‘’]
G/LD-057
‘England’, ‘Lake District’, ‘Swinside’, ‘244’, ‘802’, ‘NY 243224’, ‘’, ‘-3.1730’, ‘54.5911’, ‘1’, ‘0’, ‘06/03/2002’, ‘31/12/2099’, ‘8’, ‘19/02/2011’, ‘G4MD/P’, ‘’]
real 0m0.406s
user 0m0.373s
sys 0m0.033s
[andy@gb50linux01 ~]$
Simples! The whole thing took 10mins to write just now. I used to program in preferably C and assembler. I have to use C++ at work but I don’t like it, it’s an ugly language. Tried Java, just as complex as C++ for no benefit in reality. Now, wherever possible, I use Python. It’s so simple and expressive. Moreover is the sheer power of the language to solve problems that take lots of coding in other languages. And that program runs unaltered on Windows, Linux, OS-X and even on my Nokia phone. Hey if Python is good enough to run Google it’s good enough for me!
If you need some bits of data etc. just ask.
Andy
MM0FMF