I need to read a file into a dictionary but it contains more than one separator:
AGE 32
JOB clerk
NAME Bob Young
should become
d = {
"AGE": "32",
"JOB": "clerk",
"NAME": "Bob Young"
}
d = pd.read_csv("file.txt", delimiter=" ", header = None).to_dict()[0]
fails since NAME has a second whitespace. How can I suppress the second delimiter?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…