Go Down

Topic: Address correct line in csv file on SD and display on LCD (Read 249 times) previous topic - next topic

Try_and_Error

My problem: Every day the data of three different companies  should be displayed on LCD (company, city, street, phone).  The company data is in a csv file, with the following structure (date, company, city, street, phone), i.e. 3 lines for each day (=1.095 lines for the year).

I guess I need SD for this csv file because of the data volume? How can I address the correct lines in the CSV file that match with the respective date?

Sorry, but I am just a arduino beginner. Many thanks for your help.


PaulS

Quote
How can I address the correct lines in the CSV file that match with the respective date?
Do you have any control over the contents of the CSV file? If all records were the same length, AND the records are in chronological order, getting the records for today would be trivial.

If the records are variable length, or not in chronological order, you'll have to read as much of the file as needed to find the three records for today.

Doing this on an Arduino is really no different from doing it on a PC.
The art of getting good answers lies in asking good questions.

Try_and_Error

Thanks for your answer! Yes, the records are in chronological order and I can amend the records to make them all the same length. My plan it to get the correct date and time from a DCF77 radio module in order that the display changes are exactly on time.

Currently, the lines in the csv file start with the respective date, i.e:

01.01.2018 Company1; Street1; City1; Phone1
01.01.2018 Company2; Street2; City2; Phone2
01.01.2018 Company3; Street3; City3; Phone3


02.01.2018 Company4; Street4; City4; Phone4
02.01.2018 Company5; Street5; City5; Phone5
02.01.2018 Company6; Street6; City6; Phone6

etc. etc.

However, I could also renumber the records from 1 to 1095 if that is easier and then read the following day the next 3 records.

Many many thanks for your help!!

Go Up