File reading and parsing