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

182
Views
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 answers
Answer question

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 Report
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!