Use a temp file for the offsets, in case they won't all fit in RAM