From 3b7e3258fef5284cabeb05a278e04ab93b056b51 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 27 Jun 2025 16:13:28 -0500 Subject: [PATCH] Add View A Nicely-Formatted CSV In Terminal as a Workflow TIL --- README.md | 3 ++- ...view-a-nicely-formatted-csv-in-terminal.md | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 workflow/view-a-nicely-formatted-csv-in-terminal.md diff --git a/README.md b/README.md index 185e133..c18dd9b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1649 TILs and counting..._ +_1650 TILs and counting..._ See some of the other learning resources I work on: - [Get Started with Vimium](https://egghead.io/courses/get-started-with-vimium~3t5f7) @@ -1915,6 +1915,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Temporarily Hide CleanShot X Capture Previews](workflow/temporarily-hide-cleanshot-x-capture-previews.md) - [Toggle Between Stories In Storybook](workflow/toggle-between-stories-in-storybook.md) - [Update asdf Plugins With Latest Package Versions](workflow/update-asdf-plugins-with-latest-package-versions.md) +- [View A Nicely-Formatted CSV In Terminal](workflow/view-a-nicely-formatted-csv-in-terminal.md) - [View The PR For The Current GitHub Branch](workflow/view-the-pr-for-the-current-github-branch.md) ### XState diff --git a/workflow/view-a-nicely-formatted-csv-in-terminal.md b/workflow/view-a-nicely-formatted-csv-in-terminal.md new file mode 100644 index 0000000..40ca456 --- /dev/null +++ b/workflow/view-a-nicely-formatted-csv-in-terminal.md @@ -0,0 +1,23 @@ +# View Nicely-Formatted CSV In Terminal + +I'd just written and run a script to generate a CSV of data requested by a +stakeholder. Before sending it over to them, I wanted to briefly browse through +it to make sure the data passed a spot-check and that the way I structured +things looked reasonable. + +There are a dozen ways I can view a CSV file on my machine, but I wasn't +interested in opening another program or navigating to the file in Finder.app. + +I had generated the file in the terminal and I wanted to view it there. + +The Rust-built [`csvlens`](https://github.com/YS-L/csvlens) CLI is just what I +was looking for. + +```bash +$ csvlens data_report_20250627.csv +``` + +This shows the data spaced out with columns and rows and has a set of +keybindings that can be browsed with `?`. + +I got this tool from `brew install csvlens`.