parse file and find the file header