Best way of storing data in txt.file

hi to quantified self community.
I am so happy to join you guys.
my question is how to take a project as a beginner and how to save it in a file for further analysis.
I just write a script to save the heart rate and my data looks like this:
[time(date+time), heart_rate]
should I store everything in one file or best practice is to save it separately?!
what should I add next?

1 Like

Hi Mohammad,
My recommendation is to continue with your text file, keep it comma separated where each unique recording represents one row separated by a line break character. Once you feel your dataset has grown and you need more structuring and control over your data - including batch operations and/or formatting, then jump over to a spreadsheet like Excel or Sheets. You can keep tracking the same heart rate dataset in a single flat text file (remember to separate recordings by line breaks!). Once you want to track additional datasets, you can add a new flat, or an additional worksheet if storing data in a spreadsheet. Once your dataset grows to tens of thousands of recordings, your are going to want to graduate up to a database solution that gives you more efficient control and access. At each step of the way, you’ll need to migrate your scripts/apps from working with text files, to working with spreadsheets and finally databases. Good luck!



Sergio nailed it imo. Start small with what works and upgrade as you go. This is what has worked with me because in the early days my energy is mostly competing between ease of access and ease of review. As the dataset evolves and grows more complex the system adapts to need, otherwise I feel if I try to future proof myself too much I will not feel the relevance of my practices and as the ease of access lowers I’m less likely to make the necessary time for input or review.

Hope that made sense.

1 Like
  • Single file vs multiple files: How many data points are you collecting per day?
  • time(date+time): Be sure to include a time zone offset, e.g. 2020-07-13T11:27:03.000-07:00.

yes. I use for my time recording. with heart rate like this
but my question is should I compare my heart rate to something special or over time it give me inside?

You could compare your actual values to a reference target range - for example, see the target heart rate by age group table here. From this your visualization could highlight when your values are in / out of the target range.

If you are recording your heart rate 24/7, that data isn’t all that useful without context: Were you exercising? Sleeping? Watching a scary movie? Did you just eat a big meal? etc

To compare or correlate data, it helps if you can extract features like “resting heart rate” (during sleep) or “heart rate recovery rate” (during exercise).