You say you only need about 500 records out of the file. Read the records one at a time and see if each is the one you need. If so, save it, otherwise discard. Then read the next.

Be sure to enable buffering (ie, use QTextStream or the equivalent) on the file so that performance doesn't suck.