Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
How to filter and parse data from a txt file - javascript

so I am really new to programming and javascript and I am trying to filter this data that I am getting and add it to a CSV file but I am not sure how to start.

The code that I have so far is

import fetch from "node-fetch";
const api_url = 'https://media.githubusercontent.com/media/microsoft/Bing-COVID-19-Data/master/data/Bing-COVID19-Data.csv';


async function get_data_from_api(url) {
    //Data
    const response = await fetch(url);
    var data = await response.text();
    console.log(data)
}

//Calling the function,
get_data_from_api(api_url);

The way I am trying to filter the data is for the column country I only want rows for the "United States" and the state and county columns are empty. I want add those rows to a new CSV file.

This is what I am getting in the console.log for reference

S5325010,04/15/2020,34,0,0,0,16,15,42.96215,-106.7986,US,USA,United States,Wyoming,Natrona County 5428886,04/16/2020,37,3,0,0,,,42.96215,-106.7986,US,USA,United States,Wyoming,Natrona County 5432441,04/17/2020,37,0,0,0,16,,42.96215,-106.7986,US,USA,United States,Wyoming,Natrona County

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!