Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda