Then create an additional file, or use a DBMS.
If you're trying to extract certain information from a format not designed for optimal retrieval of that information, then the process will be inefficient.
Too bad.
Unless you choose to use a suitable format instead.