My initial logs file extract is as follows:
b6227|—| Thermometer: CRC matched: computed: 36 == read: 36
b6227|—| SocEvaluator: Final SoC is following to midle range, aka: SoC 64.5537%
b6227|—| SocEvaluator: Final SoC is 64.5537%
b6227|—| SocEvaluator: Final SoC is following to midle range, aka: SoC 64.5552%
From which I'd like to create a new csv for rendering curves in Excel. The CSV file should look like this:
64.5537
I tried this but didn't make it:
sed -nr 's/ Final SoC is (\d\.\d%)/\1/gp' ~/extremeCold.20220926.log > final.csv
What's wrong?
[UPDATE]
I am running on macOS Monterey (v12.5)
The very number to keep is 64.5537 from the line b6227|—| SocEvaluator: Final SoC is 64.5537%
(for you guys having read the before update question, forget about the 64.5536. It was simply the next available SoC).
64.5536
come from? Should we only look at lines containing the stringFinal SoC
? Do we need to use ? And what operating system are you using? We need to know to know what tools are available. – terdon Sep 27 '22 at 09:3364.5552
, not64.5557
? – AdminBee Sep 27 '22 at 10:35b6227|—| SocEvaluator: Final SoC is
pattern (aka 64.5537 here)and ignore the others lines – Stéphane de Luca Sep 27 '22 at 10:4664.5552
given the last line of input isb6227|—| SocEvaluator: Final SoC is following to midle range, aka: SoC 64.5552%
. – Ed Morton Sep 27 '22 at 22:54