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

185
Vistas
Show a specific row of my (large) CSV File

I'm fairly new to using external data-tables. I've found a string of code that takes data from my CSV file and converts it in to data. Please note that the complete CSV file has more than 40.000 rows. For testing I only used about 12, but I couldn't get any wiser.

Now every (correct) row of this CSV-file has the first cell marked with a date (marked as 'MM/DD/YYY). There are some booger-rows in there that do not show any date, or sometimes just a string of small text -- these can obviously be ignored.

I only want to show the rows that show a certain date, and hide all other rows in this column.

or to be more specific; I only want to show the rows that have the date of 365 days before today.

HTML:

    <table>
        <th> Date
        </th>
        <th> Time
        </th>
        <th> Message
        </th>
    </table>

JS: - with this code my large CSV file gets converted to a HTML table.

    <script src="http://d3js.org/d3.v3.min.js"></script>
    <!-- <script src="d3.min.js?v=3.2.8"></script> -->

    <script type="text/javascript" charset="utf-8">
        d3.text("data.csv", function(data) {
            var parsedCSV = d3.csv.parseRows(data);

            var container = d3.select("body")
                .append("table")

                .selectAll("tr")
                .data(parsedCSV).enter()
                .append("tr")

                .selectAll("td")
                .data(function(d) {
                    return d;
                }).enter()
                .append("td")
                .text(function(d) {
                    return d;
                });
        });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Solution: a plain Javascript filter. Since the CSV rows are converted to a HTML table, a filter would do fine.

I have yet to find out how to make the filter a default input, or how to make it dynamic based on the month and day.

about 4 years ago · Juan Pablo Isaza Denunciar
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