Value Lookup from File without Slurping With Map

I have a repository file (let's call it repo.txt)
that contain two columns like this:
1
2
3
4
5
6
AAA    0.2
AAT    0.3
AAC   0.02
AAG   0.02
ATA    0.3
ATT   0.7


Given another query vector for example:

1
2
3
vector <string> queryVec;
queryVec.push_back("AAC");
queryVec.push_back("ATT");


I would like to find the corresponding value for each query above,
yielding:

0.02
0.7

However, I want to avoid slurping whole repo.txt into an object (e.g. map).
Is there any ways to do that?

The reason I want to do that because repo.txt is very2 large size
(milions of lines,
with tag length > 30 bp), and my PC memory is too small to keep it.

Database.
or iterate through the file each time you need to do a search.
Last edited on
Topic archived. No new replies allowed.