Read Write and Change Values of .txt file


hi!!

i'm trying use sd card save data of variables in .txt file.

i'm not want use arduino eeprom, because sd card can change values more easy, directly in pc sd card.

so...

at moment know how write .txt file values want.

but don't know how change directly in arduino.


exemple

i have .txt file exacly this, inside sd card

data.txt
code: [select]

temp=21
day=0;
mouth=4



i have sd module , rtc module

the arduino works days.

i want variable "day" in case power off. when powers on, arduino start he's stops.

i have variable "day" works fine in arduino, don't know how can change in .txt file.

i found in libary "sdfat" have "seekset()".

but don't know how works. , don't find exemples how use change specific value insite file.

or, if have way change 1 value inside .txt file others variables.

and want turn .txt file bigger more variables int values make change more easy change way program works.


sorry english.

appreciate help!

quote
i don't find exemples how use change specific value insite file.
part of problem changing value 10 9 means else in file needs move left. changing 9 10 means rest of data has move right.

that possible, fixed length data far easier deal with, changing 10 09 or 09 10 means nothing moves.

how open file (read only, write only, readwrite, etc.) has lot whether changing data in file possible.

of course, since didn't bother post code, guesswork.


Arduino Forum > Using Arduino > Programming Questions > Read Write and Change Values of .txt file


arduino

Comments