parse result v2
This commit is contained in:
24
scripts/parse_lb_ls_2.py
Normal file
24
scripts/parse_lb_ls_2.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
text = """
|
||||||
|
#BS
|
||||||
|
#BC
|
||||||
|
RESULT
|
||||||
|
LB1 21406.00
|
||||||
|
LB2 22073.00
|
||||||
|
LB3 15407.00
|
||||||
|
LB4 20382.00
|
||||||
|
LS1 0.00
|
||||||
|
LS2 0.00
|
||||||
|
LS3 0.00
|
||||||
|
LS4 0.00
|
||||||
|
REND
|
||||||
|
"""
|
||||||
|
|
||||||
|
pattern = re.compile(r'(LB[1-4])\s+([\d.]+)')
|
||||||
|
|
||||||
|
matches = pattern.findall(text)
|
||||||
|
|
||||||
|
for match in matches:
|
||||||
|
label, value = match
|
||||||
|
print(f'{label}: {value}')
|
||||||
Reference in New Issue
Block a user