Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

179
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda