【发布时间】:2018-08-02 13:19:41
【问题描述】:
您能帮我弄清楚如何根据多个/组数字作为分隔符进行拆分吗?
我的文件中有以下格式的内容:
data_file_10572_2018-02-15-12-57-29.file
header_file_13238_2018-02-15-12-57-48.file
sig_file1_17678_2018-02-15-12-57-14.file
预期输出:
data_file
header_file
sig_file1
我是 python 新手,我不确定如何根据数字组进行剪切。谢谢回复!!
【问题讨论】:
标签: python python-3.x python-2.7