ply616
with open(file_name) as file:
    do_something()

多余的空格替换
由于需要用到csv文件(Excel的视图功能,所以需要把连着的空白符替换为逗号,这样方便查看)

import re
file_out = open(filename,"w")
#注意换行
file_out.write(re.sub(\'\s+\',\',\',line).strip() + "\n")
#注意最后file_out.close()

分类:

技术点:

相关文章:

  • 2021-12-07
  • 2021-06-24
  • 2022-12-23
  • 2022-02-22
  • 2021-12-19
  • 2021-12-15
  • 2021-10-15
  • 2021-12-31
猜你喜欢
  • 2022-02-09
  • 2021-09-01
  • 2022-02-10
  • 2022-12-23
  • 2022-01-07
  • 2021-08-12
相关资源
相似解决方案