I have a big text file (2 GB) with 4 columns looking like this:

1 10583 10583 0.14
1 10611 10611 0.02
1 13302 13302 0.11

I also have another file where I have extracted a string of information and if this string matches col1:col2:col3 then I want to extract "A", ie col4. The file above is so big and I don't know how to go through in a faster way then just opening it and reading it.


First of all, looks like you have doubled values at col 2 and col3, so you can keep only one of them, you could produce upto 100 sorted files by the two first digits of col1.

But important thing is how big this second file is? If it is not huge, you have no problem. Just use the Gribouillis' code snippet to buffer reading of the huge file

That's really big, see if you can find a way to spilt the .text, or use as the mod said the code snippet.