2
I am going to fetch some data from a file in ics format. The problem is that the file can change several times. I have this code to put in each variable each data of a certain line in the file. Example:
for line in f:lines() do
f line:sub(1,5) == "RRULE" then --objet
rule = line
freq = string.match(rule,"FREQ=(.*);")
until_ = string.match(rule,"UNTIL=(.*)")
interval = string.match(rule,"INTERVAL=(.*)")
count = string.match(rule,"COUNT=(.*)")
end
end
And these are the many examples of the file line I can get:
RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5
RRULE:FREQ=DAILY;INTERVAL=2
RRULE:FREQ=DAILY;UNTIL=19971224T000000Z
How can I get to put in each different variable?
What’s the matter?
– Maniero
I want to get each parameter of the RRULE line in each variable. For example get the "DAILY" in the freq variable. My problem is that not everyone always ends up with one ;
– akm
What are the various tabs in your file?
– bruno
The line separators are the point and comma. But using the various examples of the RRULE lines, my code does not work correctly.
– akm
You can for an example run showing exactly how it works and what is going wrong?
– Maniero