Hi all,
I have a big file with the following format:
<key> <value> 6 9913 8 9913 10 9913 12 9913 14 9913 32 14456 35 9913 42 9913 44 24 46 24 50 24 [...]
The first column has sorted unique numbers and the second values associated with them. I need to look up this file using the first column as keys. For example, 32 -> 14456
I can't load the file in a hash (doesn't fit into memory), and reading one line at a time is too slow (even if I sort the numbers to search). Building an index seems useless too (the index wouldn't fit into memory and if I write in a file, the problem would be the same).
What would be the best way (defining best as the ratio between efficiency / simplicity of implementation) of doing this?
Is making a DB with the file or writing C subroutines to access the file the only way of improving this task?
Thanks in advance
citromatik
In reply to fast lookups in files by citromatik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |