数据的格式为“25.91”
这样我有多行
我正在尝试提取数字字符数据25.91
25.91
我已经尝试过为此编写代码,但有些东西就是不起作用
import re
myfile = open("BOMR1_.txt")
for line in myfile:
line=line.rstrip()
StartMP = re.findall(r'^xml.*<FROM>([0-9.]+)', line)
if len(StartMP)> 0:
Print (StartMP)
我想查看以下数据:
Startmp=25.91,依此类推
Tags:
使用正则表达式解析XML等分层数据格式不是一个好主意。有关正则表达式处理器本身不在解析器中的原因的更多详细信息,请参见this fantastic article
那篇文章的关键一段是:
相关问题 更多 >
编程相关推荐