recursively parse file