Hi all, I’m attempting to retrieve values collected from my weather station to store in items. At the moment I’m doing this in an overly complicated way using a custom console application written in c#. I am wanting to move from Windows to RPi in the near future, so this will no longer be a viable option. I’m thinking there must be a fairly simple way to parse the text file, but my reading of the transformation add-ons is that none of them are quite right for the job. Following is an example of the text file:
Not sure what I’m doing. I’ve used val String newString = transform(“REGEX”, “High=(.*?)\n”, rawWeather), regex101 seems to be happy (although it returns multiple matches). Any regex experts able to assist?
Brilliant. That’s gotten me closer! So the only problem now is that High is used several times throughout the file and the current regex returns the last match. For example,
In the above example, the figure returned would be the heatindex high. Is it possible to stop at just the first match? Or better yet, specify which match # to keep. I’m researching regex but not figuring it out.