open the file into memory and do simple preprocessing