Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 473

Help: Rainmeter Skins • RegExp - parsing "simple" text file with Key=Value ending with newline

$
0
0
Dear Team, I did "my best" in the last hours, but I continue to fail with this "simple" task. Could you please have a quick look, why this regexp does not work? I always get RegExp matching error (-1)

Goal: Capturing these 7 strings/values from below file1.txt file in a standard Key=Value(newline) format:
1) 20240616164427
2) 22
3) (Updated 12 mins ago)
4) 12
5) 0.1
6) 14.5
7) <div style=XXXXX</div>

This is my regexp, using \n (newline) to close each capturing group, I also tried \n\r - also does not work... I also tried escaping the equal signs \= but no joy. I'm really stuck :-(

Code:

[Parser1]Measure=WebParserUpdateRate=600URL=file://#CURRENTPATH#file1.txtRegExp=(?siU)LastRunTime=(.*)\nTotalRuntime\(secs\)=(.*)\nLastUpdatedAgo_Original=(.*)\nLastUpdatedAgo_minutes=(.*)\nCurrentBatteryCharge=(.*)\nImported_kWh=(.*)\nProduced_kWh=(.*)\n\nMetricsTrend_pos_SVG=(.*)\nMetricsTrend_neg_SVG=(.*)\nDynamicVariables=1

Code:

[Status]LastRunTime=20240616164427TotalRuntime(secs)=22(A)=---[Output]LastUpdatedAgo_Original=(Updated 12 mins ago)LastUpdatedAgo_minutes=12(B)=---Imported_kWh=0.1Produced_kWh=14.5(C)=---MetricsTrend_pos_SVG=<div style=XXXXX</div>

Statistics: Posted by emp00 — June 16th, 2024, 4:38 pm — Replies 3 — Views 91



Viewing all articles
Browse latest Browse all 473

Trending Articles