我正在尝试根据下面的输入创建一个列表,但我没有看到预期的输出。谁能建议我哪里出错了?
输入:
CR FA CL Title
409452 WLAN 656885 Age out RSSI values from buffer in Beacon miss scenario
415560 WLAN 656886 To Record SMD Event Logging
我想要一个像
[['CR', 'FA', 'CL', 'TITLE'], ['409452', 'WLAN', '656885', 'Age out RSSI values from buffer in Beacon miss scenario'], ['415560', 'WLAN', '656886','To Record SMD Event Logging']]
但我看到它的创建就像
[['CR', 'FA', 'CL', 'TITLE'], ['', '409452', 'WLAN', '656885\tAge out RSSI values from buffer in Beacon miss scenario'], ['', '415560', 'WLAN', '656886\tTo Record SMD Event Logging']]
Python代码
for i in info.splitlines():
index = re.split(r'\W+',i,3)
CRlist.append(index)