【发布时间】:2020-07-17 18:21:34
【问题描述】:
寻找 sed 或 awk 表达式以将键值转换为特定格式。在这种情况下,pass 没有值,所以它应该显示一个空字符串。
输入:
login: me pass: time: Wed 2020 07 message: There is a cat in the house
期望的输出:
login="me" pass="" time="Wed 2020 07" message="There is a cat in the house"
【问题讨论】:
-
你有没有为此尝试过?
-
尝试在python中进行拆分,但并未涵盖所有情况...