From 9cafbf2120035638493aab8b6b0db37a1a49da9e Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Sun, 7 Jan 2024 23:06:53 +0530 Subject: [PATCH] parse result v2 --- scripts/parse_lb_ls_2.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/parse_lb_ls_2.py diff --git a/scripts/parse_lb_ls_2.py b/scripts/parse_lb_ls_2.py new file mode 100644 index 0000000..cc630f5 --- /dev/null +++ b/scripts/parse_lb_ls_2.py @@ -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}')