user4399: Sequel to this question: Live statistics chess960 from chess.com?
So suppose I go to like
https://api.chess.com/pub/player/gmwso/games/2020/12
or
https://api.chess.com/pub/player/gmwso/games/2020/12/pgn
there's gonna be a bunch of stuff like say
[UTCDate "2018.01.03"]
[WhiteElo "2706"]
[BlackElo "2940"]

How do I get this data into a spreadsheet like column 1 is all the dates, column 2 is the corresponding white elo, column 3 black elo, col4 white username and col5 black username?

Update 2: Fixed now. see the 'json' vs the 'preformed'. WOW.
Update 1: It appears Mike Steelson has an answer here, where the code is given as
=arrayformula( regexextract(split( substitute(substitute(substitute(getDataJSON(A1;"/games";"/pgn");"[";"");"]";"");"""";"") ;char(10));"\s.*") )

with an example given here
https://docs.google.com/spreadsheets/d/1MX1o5qdy0K3gTMzbimUV3SmFf-0XPCSJ8Vz4IjI-8Ak/copy
It appears there's a problem when it gets to the case of chess960 only. Consider for example this player: Replacing 'gmwso' with the player's username will yield a weird output. i imagine the output will be messier for mixed chess960 and chess.

user4399: Update 2: Fixed now. see the 'json' vs the 'preformed'. WOW.
Update 1: It appears Mike Steelson has an answer here, where the code is given as
=arrayformula( regexextract(split( substitute(substitute(substitute(getDataJSON(A1;"/games";"/pgn");"[";"");"]";"");"""";"") ;char(10));"\s.*") )

with an example given here
https://docs.google.com/spreadsheets/d/1MX1o5qdy0K3gTMzbimUV3SmFf-0XPCSJ8Vz4IjI-8Ak/copy
It appears there's a problem when it gets to the case of chess960 only. Consider for example this player: Replacing 'gmwso' with the player's username will yield a weird output. i imagine the output will be messier for mixed chess960 and chess.

user4418: First, worth noting that this question has nothing to do with chess. It is a programming question and a simple one at that.
The answer is very simple. Write a program to read the files and parse them. The pseudo-code looks something like this:
Read the file
For each line

find and extract any keywords like "WhiteELO", "UTCDate", etc.
If there is no keyword then throw the line away (or do something else if you need to)
If there is a keyword then extract and store the associated data

Once you have processed all the lines of the game in the pgn then write a formatted line to your output file.
Note that for spreadsheet-readable files you can use something like ";" (semicolon) as the field delimiter. Probably better than "," (comma) since the title and player name fields are likely to contain commas.
Note that there was nothing whatsoever to do with chess in that answer. It was all simple data processing.

user-1: 
How do I get this data into a spreadsheet like column 1 is all the dates, column 2 is the corresponding white elo, column 3 black elo, col4 white username and col5 black username?

From the .pgn file downloaded at
https://api.chess.com/pub/player/gmwso/games/2020/12/pgn
I have created a file called chess_games.xlsx and I have inserted the five values you are asking using a python2 script. You need to install chess and openpyxl libraries with pip. The .pgn file is read as a long string.
import pgn
import openpyxl
import os

pgn_text = open('ChessCom_gmwso_202012.pgn').read()

dates = []
welo = []
belo = []
white = []
black = []

whiteLong = []
blackLong = []

def getValues(file):
    test_str = file
    test_date = "[Date"
    res1 = [i for i in range(len(test_str)) if test_str.startswith(test_date, i)]
    test_welo = "[WhiteElo"
    res2 = [i for i in range(len(test_str)) if test_str.startswith(test_welo, i)]
    test_belo = "[BlackElo"
    res3 = [i for i in range(len(test_str)) if test_str.startswith(test_belo, i)]
    test_white = "[White "
    res4 = [i for i in range(len(test_str)) if test_str.startswith(test_white, i)]
    test_black = "[Black "
    res5 = [i for i in range(len(test_str)) if test_str.startswith(test_black, i)]
    for i in res1:
    dates.append(test_str[i+7:i+17])
    for i in res2:
        welo.append(test_str[i+11:i+15])
    for i in res3:
        belo.append(test_str[i+11:i+15])
    for i in res4:
        whiteLong.append(test_str[i+8:i+43]) //The max length of a nickname in chess.com is 35 characters
    for i in res5:
        blackLong.append(test_str[i+8:i+43])
    for value in whiteLong:
        posClose = value.find("]")
        white.append(value[0:posClose-1])
    for value in blackLong:
        posClose = value.find("]")
        black.append(value[0:posClose-1])

def generateExcel(dates,welo,belo,white,black):
    file = 'chess_games.xlsx'
    if os.path.isfile(file):
        wb = openpyxl.load_workbook(filename=file)
    else:
        wb = openpyxl.Workbook()
    ws = wb["chess_games"]
    for k in range (len(dates)):
        ws['A'+str(k+1)] = dates[k]
    for k in range (len(welo)):
        ws['B'+str(k+1)] = welo[k]
    for k in range (len(belo)):
        ws['C'+str(k+1)] = belo[k]
    for k in range (len(white)):
        ws['D'+str(k+1)] = white[k]
    for k in range (len(black)):
        ws['E'+str(k+1)] = black[k]
    wb.save(file)

getValues(pgn_text)
generateExcel(dates,welo,belo,white,black)

Download the output .xlsx file

4399: <p>Sequel to this question: <a href="https://chess.stackexchange.com/questions/34842/live-statistics-chess960-from-chess-com">Live statistics chess960 from chess.com?</a></p>
<p>So suppose I go to like</p>
<p><a href="https://api.chess.com/pub/player/gmwso/games/2020/12" rel="nofollow noreferrer">https://api.chess.com/pub/player/gmwso/games/2020/12</a></p>
<p>or</p>
<p><a href="https://api.chess.com/pub/player/gmwso/games/2020/12/pgn" rel="nofollow noreferrer">https://api.chess.com/pub/player/gmwso/games/2020/12/pgn</a></p>
<p>there's gonna be a bunch of stuff like say</p>
<pre><code>[UTCDate &quot;2018.01.03&quot;]
[WhiteElo &quot;2706&quot;]
[BlackElo &quot;2940&quot;]
</code></pre>
<p>How do I get this data into a spreadsheet like column 1 is all the dates, column 2 is the corresponding white elo, column 3 black elo, col4 white username and col5 black username?</p>
<hr />
<p>Update 2: Fixed now. see the 'json' vs the 'preformed'. WOW.</p>
<p>Update 1: It appears Mike Steelson has an answer <a href="https://stackoverflow.com/questions/67345784/how-do-convert-parse-extract-data-from-a-pgn-into-a-spreadsheet-google-sheet-exc">here</a>, where the code is given as</p>
<pre><code>=arrayformula( regexextract(split( substitute(substitute(substitute(getDataJSON(A1;&quot;/games&quot;;&quot;/pgn&quot;);&quot;[&quot;;&quot;&quot;);&quot;]&quot;;&quot;&quot;);&quot;&quot;&quot;&quot;;&quot;&quot;) ;char(10));&quot;\s.*&quot;) )
</code></pre>
<p>with an example given here</p>
<p><a href="https://docs.google.com/spreadsheets/d/1MX1o5qdy0K3gTMzbimUV3SmFf-0XPCSJ8Vz4IjI-8Ak/copy" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1MX1o5qdy0K3gTMzbimUV3SmFf-0XPCSJ8Vz4IjI-8Ak/copy</a></p>
<p>It appears there's a problem when it gets to the case of chess960 only. Consider for example <a href="https://www.chess.com/member/dukov5" rel="nofollow noreferrer">this player</a>: Replacing 'gmwso' with the player's username will yield a weird output. i imagine the output will be messier for mixed chess960 and chess.</p>
 4399: <p>Update 2: Fixed now. see the 'json' vs the 'preformed'. WOW.</p>
<p>Update 1: It appears Mike Steelson has an answer <a href="https://stackoverflow.com/questions/67345784/how-do-convert-parse-extract-data-from-a-pgn-into-a-spreadsheet-google-sheet-exc">here</a>, where the code is given as</p>
<pre><code>=arrayformula( regexextract(split( substitute(substitute(substitute(getDataJSON(A1;&quot;/games&quot;;&quot;/pgn&quot;);&quot;[&quot;;&quot;&quot;);&quot;]&quot;;&quot;&quot;);&quot;&quot;&quot;&quot;;&quot;&quot;) ;char(10));&quot;\s.*&quot;) )
</code></pre>
<p>with an example given here</p>
<p><a href="https://docs.google.com/spreadsheets/d/1MX1o5qdy0K3gTMzbimUV3SmFf-0XPCSJ8Vz4IjI-8Ak/copy" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1MX1o5qdy0K3gTMzbimUV3SmFf-0XPCSJ8Vz4IjI-8Ak/copy</a></p>
<p>It appears there's a problem when it gets to the case of chess960 only. Consider for example <a href="https://www.chess.com/member/dukov5" rel="nofollow noreferrer">this player</a>: Replacing 'gmwso' with the player's username will yield a weird output. i imagine the output will be messier for mixed chess960 and chess.</p>
 4418: <p>First, worth noting that this question has nothing to do with chess. It is a programming question and a simple one at that.</p>
<p>The answer is very simple. Write a program to read the files and parse them. The pseudo-code looks something like this:</p>
<p>Read the file<br />
For each line</p>
<ol>
<li>find and extract any keywords like &quot;WhiteELO&quot;, &quot;UTCDate&quot;, etc.</li>
<li>If there is no keyword then throw the line away (or do something else if you need to)</li>
<li>If there is a keyword then extract and store the associated data</li>
</ol>
<p>Once you have processed all the lines of the game in the pgn then write a formatted line to your output file.</p>
<p>Note that for spreadsheet-readable files you can use something like &quot;;&quot; (semicolon) as the field delimiter. Probably better than &quot;,&quot; (comma) since the title and player name fields are likely to contain commas.</p>
<p>Note that there was nothing whatsoever to do with chess in that answer. It was all simple data processing.</p>
 -1: <blockquote>
<p>How do I get this data into a spreadsheet like column 1 is all the dates, column 2 is the corresponding white elo, column 3 black elo, col4 white username and col5 black username?</p>
</blockquote>
<p>From the .pgn file downloaded at</p>
<p><a href="https://api.chess.com/pub/player/gmwso/games/2020/12/pgn" rel="nofollow noreferrer">https://api.chess.com/pub/player/gmwso/games/2020/12/pgn</a></p>
<p>I have created a file called chess_games.xlsx and I have inserted the five values you are asking using a python2 script. You need to install chess and openpyxl libraries with pip. The .pgn file is read as a long string.</p>
<pre><code>import pgn
import openpyxl
import os

pgn_text = open('ChessCom_gmwso_202012.pgn').read()

dates = []
welo = []
belo = []
white = []
black = []

whiteLong = []
blackLong = []

def getValues(file):
    test_str = file
    test_date = &quot;[Date&quot;
    res1 = [i for i in range(len(test_str)) if test_str.startswith(test_date, i)]
    test_welo = &quot;[WhiteElo&quot;
    res2 = [i for i in range(len(test_str)) if test_str.startswith(test_welo, i)]
    test_belo = &quot;[BlackElo&quot;
    res3 = [i for i in range(len(test_str)) if test_str.startswith(test_belo, i)]
    test_white = &quot;[White &quot;
    res4 = [i for i in range(len(test_str)) if test_str.startswith(test_white, i)]
    test_black = &quot;[Black &quot;
    res5 = [i for i in range(len(test_str)) if test_str.startswith(test_black, i)]
    for i in res1:
    dates.append(test_str[i+7:i+17])
    for i in res2:
        welo.append(test_str[i+11:i+15])
    for i in res3:
        belo.append(test_str[i+11:i+15])
    for i in res4:
        whiteLong.append(test_str[i+8:i+43]) //The max length of a nickname in chess.com is 35 characters
    for i in res5:
        blackLong.append(test_str[i+8:i+43])
    for value in whiteLong:
        posClose = value.find(&quot;]&quot;)
        white.append(value[0:posClose-1])
    for value in blackLong:
        posClose = value.find(&quot;]&quot;)
        black.append(value[0:posClose-1])

def generateExcel(dates,welo,belo,white,black):
    file = 'chess_games.xlsx'
    if os.path.isfile(file):
        wb = openpyxl.load_workbook(filename=file)
    else:
        wb = openpyxl.Workbook()
    ws = wb[&quot;chess_games&quot;]
    for k in range (len(dates)):
        ws['A'+str(k+1)] = dates[k]
    for k in range (len(welo)):
        ws['B'+str(k+1)] = welo[k]
    for k in range (len(belo)):
        ws['C'+str(k+1)] = belo[k]
    for k in range (len(white)):
        ws['D'+str(k+1)] = white[k]
    for k in range (len(black)):
        ws['E'+str(k+1)] = black[k]
    wb.save(file)

getValues(pgn_text)
generateExcel(dates,welo,belo,white,black)
</code></pre>
<p><a href="https://drive.google.com/file/d/1No90sn2BUy9ujUlUGxgbXTCpXARb0TDG/view?usp=sharing" rel="nofollow noreferrer">Download the output .xlsx file</a></p>
