You could use an sqlite database in conjunction with your current layout. The data would just be duplicated in the two formats but you'd get the best of both worlds.

If disk space is important, you might consider using sqlite's feature of creating a database in memory. That way your software would have to chug through the data only once before performing any complex queries.

Good luck