I just work with my Raspberry Pi with a log-file which is updated each minute. Could someone help me with the code to read the content of the file and search for the right value in it? Furthermore, I should save the data which are read in a database.
To read a file, use FolderItem
To save values into a db, use the Database Class
What database do you want to use?
Yo can use InStr to search for a string.
But how can I convert the FolderItem to a string? Because in the “temp1.txt” file is the word “temperature” stored and after it is a unknown value which I have to read and store in the table.
I think I will use a MySQL database.
Here is me current code:
dim s as string
dim f as FolderItem
f= GetFolderItem("temp1.txt")