I got stuck on this part of my skin.
Code: Select all
[MeasureTail]
Measure=Script
ScriptFile=#@#scripts\TailFile.lua
UpdateDivider=#SecondsBetweenRead#
[MeasureLine1]
Measure=String
RegExpSubstitut=1
Substitute="^(\d{1,2})\/(\d{1,2})\/(\d{4})\s(\d{2}):(\d{2}):(\d{2})\sAM,(\d{1,4}RPM)$":""
I tried different things... but it doesn't even change a single character.
Here is the string I'm trying to substitute to only keep the value (I don't even want the postfix):
Code: Select all
23/8/2021 23:17:24 PM,1494RPM
I also wonder if it would be possible to directly get the value from the file instead of the whole string but it's starting to be a bit too complicated for me. I'm currently using Script that I found on this forum to get it :
Code: Select all
function Initialize()
fileToRead = SKIN:GetVariable('FileToRead')
linesToTail = tonumber(SKIN:GetVariable('LinesToTail'))
childPrefix = SKIN:GetVariable('ChildPrefix')
end
function Update()
local inputFile = io.open(fileToRead, 'r')
local text, ch
local pos = -1
local i = 1
repeat
inputFile:seek("end", pos - 1)
ch = inputFile:read(1)
if ch == '\n' then
text = inputFile:read(-pos)
if text ~= nil then
SKIN:Bang('!SetOption', childPrefix..i, 'String', string.match(text, "^(.-)\n"))
SKIN:Bang('!UpdateMeasure', childPrefix..i)
i = i + 1
pos = pos - 1
end
end
pos = pos - 1
until (i > linesToTail)
io.close(inputFile)
SKIN:Bang('!UpdateMeter', '*')
SKIN:Bang('!Redraw')
return 0
end