I'm making one project in which SD card or pendrive has all the data. the data file contains one string and Two integers. i want to read all three data fields at a time and store in three different variables.
so, in which file format i can save the file in storage devices?
How i can read the data from storage devices and put in variables of arduino?
How many number of arduino's can access the same storage device at a time?
Generally, it you want to read data from a file on an Arduino you use one with an SD card socket or add a shield that has one.
File format is up to you. A text file is easy to read from.
Your last question is more tricky. In the scenario I described, the answer is obviously one. Are you planning to have the pen drive attached to a PC instead?
shreekantha_v:
I'm making one project in which SD card or pendrive has all the data.
To use USB storage you would first have to add a USB Host Shield to most Arduinos. For an SD card you just need an SD socket connected to the SPI pins.
shreekantha_v:
the data file contains one string and Two integers. i want to read all three data fields at a time and store in three different variables.
shreekantha_v:
so, in which file format i can save the file in storage devices?
I would use a text file. Given the choice, I would put the two integers first and then the string, ending with a newline character ('\n') as an end marker.
shreekantha_v:
How i can read the data from storage devices and put in variables of arduino?
You would use the file.read() functions.
shreekantha_v:
How many number of arduino's can access the same storage device at a time?
Just one, but that one could communicate with others to share the data.
Use file.position() to get the current file position. Save that in a variable. Use file.seek() to go back to that position so you can read that line again.
You can't read backward with readStringUntil(). Only forward.