title: How do convert/parse/extract data from a PGN into a spreadsheet/google sheet/excel file?
body: <p>Sequel to this question: <a href="https://stackoverflow.com/questions/67159513/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>