Search code examples
sumextractspotify

How to extract specific lines from a text document?


I am no expert in coding or anything but I figured it out this website would be the best to achieve what I want. So, I got my personal data from Spotify, and they give you how much you played a song and all of the play history and I want to calculate how much I listened in total, the problem is I don't know how can I extract the specific lines from the text document with only the time and then calculate it.

The text is something like this:

  {
    "endTime" : "2020-11-21 22:23",
    "artistName" : "Kanye West",
    "trackName" : "Devil In A New Dress",
    "msPlayed" : 351946
  },

and there are a lot of songs, I just want to extract the "msPlayed" thing so I can calculate it, any help?


Solution

    1. Go here: https://regex101.com/r/RLDYUj/1
    2. Put your text into the "Test String" part
    3. Copy in your clipboard the numbers list in the "Substitution" part
    4. Go here: https://miniwebtool.com/sum-calculator/
    5. Paste the numbers list and compute the sum