Display any CSV file as a searchable, filterable, pretty HTML table (github.com)
I combined this with a simple API to update a CSV file using Deno/deno-csv library, allowing an Ansible job to easily update a CSV file via the API with Ansible URI module, and then have that same CSV file viewable/downloadable in a simple and easy/dashboardy way (with CSV-to-html-table). Copilot created the Deno/deno-csv CSV API code and then with a little back and forth I added static website functionality (to serve the CSV table), and I had a /view and a /update route. I'm just a sysadmin but I love piecing together stuff like this. Thanks Derek!
71 comments
[ 1226 ms ] story [ 1735 ms ] threadI saw your comment and didn't quite clock that you're not the author. Sorry about that. We've reversed the changes to make it a normal post again.
https://jsfiddle.net/ypfr98su/5/
Just a reminder that it's possible and often built into our work environments, while we pretend it's not there.
I hadn't understood how different Powershell is, compared with cmd.exe of old.
My hottest of takes...Powershell is the easiest way to write consistent scripts across the big three OSes.
But honestly often when I talk to people they don't know the basics of cmd.exe, even if they worked with it for years. Like... surprised that it has pipes :) And apparently it's been there since DOS 2.0 (early 1980's).
Are there other tools like it?
Got a collection of larger CSV files that I wanted to include on a Astro Starlight project of mine.
I'm a developer and piecing stuff together is my favorite part of the job. The joy is in the design, the actual coding is just a means to an end.
I've written similar browser tools for handing tabular data. One neat thing I've learned is if you copy and paste from Excel into an html `textarea`, you get the data as tab delimited text. Add a `paste` event handler to the `textarea` then parse the data in code.
you can also use Kanaries if you are looking for some more detailed "Tableau" like analytics platform.
*EDIT* Would probably be easier to start a new one and maybe use PapaParse to parse the CSV.
https://github.com/pavelsr/csv-to-tablesorter
[1] https://www.getgrist.com/csv-viewer/
I thought custom formatting would be changing colors and widths text wrappings.
And maybe add a head wrapper?
Plugins like datasette-extract (AI powered data extraction) are amazing: https://www.youtube.com/watch?v=g3NtJatmQR0