python 将文本中多个空格转换为逗号生成csv
关键会使用 str.split( ),split 函数参数为空时会将单个空格或多个空格去掉生成列表
#ConvertCSV.py
ls = open("../material/procrank.txt").readlines()
newTxt = ""
for line in ls:
newTxt = newTxt + ",".join(line.split()) + "\n"
prin...
原创
2020-03-04 19:41:24 ·
5411 阅读 ·
0 评论