format_data.txt
test login_id: userid
authority: root folder: root123
login password: 1234***
Python script
import re
textwith =open('format_data.txt', 'r'''
test) login_id:as userid
authorityf:
root folder: root123
login password: 1234***
'''.lstrip()
data = [{k: v} for k, v in re.findall(r'\s*(.+?):\s+([^\s]+)', textf.read())]
print(data)
# [{'test login_id': 'userid'}, {'authority': 'root'}, {'folder': 'root123'}, {'login password': '1234***'}]