add unified function yaml_to_txt