I am pulling multiple stats from a json file for a simulated basketball league. I am dumping into an array and then saving as csv. I am using power query to manually add headers to the csv but this seems inefficient. I want the columns to be named the same as the keys listed below in the code. Any guidance is appreciated.
jq -r '.games[] | [.gid, .day, .season, .playoffs, .numPeriods, .overtimes, (.won | .tid, .pts), (.lost | .tid, .pts)] | join(", ")'