in reply to load a file in memory and extract parts
Obviously, the first notion that pops into my mind is: “this would be a great application for an SQLite database file!”
SQLite, as you know, is a powerful SQL system that stores everything into just one file. It already has existing facilities to import a CSV-file. It can quite-effortlessly import your file into a table, then create indexes on that table to allow the key (which consists of two columns ...) to be retrieved very fast. You can, if you like, even import the incoming file into another table, and then your entire problem has basically been reduced to an INNER JOIN.
Food for thought, anyway. Personally, I love to stumble-upon situations where I don’t have to write a single line of “programming” in order to solve a problem. Maybe this will work for you; maybe not. But if it does, you could chomp this entire problem in a matter of minutes.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: load a file in memory and extract parts
by healingtao (Novice) on May 06, 2015 at 16:36 UTC | |
by toolic (Bishop) on May 06, 2015 at 16:52 UTC | |
by healingtao (Novice) on May 06, 2015 at 17:17 UTC | |
by afoken (Chancellor) on May 06, 2015 at 19:31 UTC |