Storing the Data from the sensor in CSV format

I have a sensor that transmits the data in real time and I have linked the data to store in a Google Sheet, but now I need to store the data in CSV format on my phone(which should be used by other apps and viewable and no sd card type storage) and I'm pretty confused to what property of the File Component(Default Scope) must be set {Either legacy/shared but not App for sure}.
So guide me in this from scratch.
I'm using Android 10 Redmi Note 7s
The sensor transmits Timestamps,Current,Humidity and 4 different types of sensors
Where I have store all of this in a CSV format
Where by reading a few discussion topics I came to this idea.