Say I have the following dictionary:
data=[a 1 : A, b 2 : B, c 3 : C, d 4 : D]
and a .txt file which reads:
Key a 1 b 2 c 3 d 4
Word as box cow dig
(note values are seperated by TAB character)
How can I use the keys from the data dictionary to find the corresponding word from the .txt file? Ideally I would like to output a dictionary like:
data=[a 1 : as, b 2 : box, c 3 : cow, d 4 : dig]
Please ask for more info. if needed.
Thanks,
Alex
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…