Go Down

Topic: Need Help about data conversion read from one file and and writing to another. (Read 177 times) previous topic - next topic


I am working on data conversion where in the main data file is on the sd card.

I am able to read the file convert it but and save to another created file on the same card but only one line.

Either i can read or i can write but never both properly.

To simplify:
I am reading  one whole line from a text file     eg:010101110001001000001011    (400bit in one line)
close the file

Convert data   eg:01010111,00010010,00001011   later to bytes

write to the other file     eg:01010111,00010010,00001011
close the file

I am able to read and write the first line not the next line.

Is it the issue between file open and file close.  Or any other way.

Will post the code after cleaning as its messed up.

Thanking you


You can seek; so after opening the input file again, seek N bytes. Next time seek N*2 bytes, next time N*3 bytes etc. N is the number of bytes of a record.

The SdFat library seems to allow you to open multiple files at the same time (source: https://forum.arduino.cc/index.php?topic=51087.0) and that way you should be able to circumvent the probem.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Go Up