group_id, application_id, reading
If they are sorted by the group id you can use the csv module to iterate over the rows in the files and output it. You can find information about the module here.