0

here is my js code

const {match} = require("assert")
const csv = require("csv-parser")
const fs = require("fs")
const results = []

fs.createReadStream("IPL Matches 2008-2020.csv")
  .pipe(csv({}))
  .on("data", (data) => results.push(data))
  .on("end", () => {
for(let i=0;i<816;i++){
    if("Sunrisers Hyderabad"===results[i].winner){
      console.log(results[i].venue)
    }
 })

here is the console output of list of stadiums, i want to display it something like

Rajiv Gandhi International Stadium, Uppal:2

Feroz Shah Kotla:1

Rajiv Gandhi International Stadium, Uppal
Rajiv Gandhi International Stadium, Uppal
Feroz Shah Kotla
Subrata Roy Sahara Stadium
Rajiv Gandhi International Stadium, Uppal
Rajiv Gandhi International Stadium, Uppal
Rajiv Gandhi International Stadium, Uppal
Punjab Cricket Association Stadium, Mohali

haseen
  • 17
  • 3
  • Looks like you want a 'group-by' [How can I group an array of objects by key?](https://stackoverflow.com/questions/40774697/how-can-i-group-an-array-of-objects-by-key). But you'll need to post an example of your data if you want concrete help. – pilchard Feb 20 '22 at 11:56

0 Answers0