Live data from Hacker News

Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

github.com

81–90 of 141 posts

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#81

Earlier quoted context omitted.

The NA detection and higlighting is nice but I'm not sure how I feel about showing anything other than the exact textual value. I don't mind abridging quotes when they're not necessary, but showing "N/A", NA,, etc. as the same value is a bit iffy.

It is rough. There are many ways that different tools put NAs, na, N/A, "", etc. in a file. To chose only "NA" would mean I would be excluding the output of other tools. I chose accessibility over specificity. #trade-offs.

Fair enough but that doesn't explain why you chose to display all of them as "NA". As you say there are lots of different ones, hence it would be a bad idea to pick one as the 'default' to display. To me it's important whether something is missing, filled with "N/A", or "null", or "Not Applicable" etc.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#82
post #8

Consider adding a code snippet showing a.csv output. I had to watch a video just to see text.

I have some work to do on the README. I will show the output better. The difficulty with showing the output only is that it does not capture the coloring. Maybe I will show the output, or add a picture, or have an animated gif. Maybe all three.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#83
post #26

There should be a new package next to the traditional gnu tools containing the modern needed tools e.g. jq, curl or tv. Sometimes i really miss the extended sw package on some machines?

Sounds like a good "awesome" page on github.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#84

Very nice! How does it handle CSVs that are wider or longer than the terminal? How does it deal with columns that are exceptionally long, or multiline? Often when working with large CSV files, I'll need to show or hide specific columns, especially if they are very long. Also, grepping the output for a specific line will hide the header as well, not to mention make the output unnecessarily wide if non-matching lines h…

> How does it handle CSVs that are wider or longer than the terminal? Columns that are exceptionally long but cutting and appending an ellipsis if the line is over 20 characters. > a built-in grepping feature would make this very useful. see the following for csv data manipulation: xsv - Command line csv data manipulation. Rust csvtk - Command line csv data manipulation. Go tsv-utils - Command line csv data manipulat…

Terrific, thank you!

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#85

I spend a lot of time in the terminal and want to quickly glance at a csv files without making a new script, opening excel, or using a tui. I made tidy-viewer (tv) because current tools like cat and column were not pretty enough. tv modifies raw files in the following ways: 1. NA detection and highlighting 2. Printing only significant digits 3. Header and footer meta data I have been using this a lot at work. There i…

Your asciinema playback made me twitch. Is the lack of a trailing space in your PS1 intentional?

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#86

What is the value-add when compared to using `xsv` to pretty print? Is it only the fact that it highlights NA values?

xsv is one of my favorite data manipulation tools. Also, the author of that package is one of the best developers I know. I use xsv with tv. I normally pipe the output of xsv to tv.

1. As you noted NA comprehension 2. Column overflow logic for different sized terminals 3. Summary meta data in the header 4. Significant digits logic. This allows users to view more columns than they would otherwise view due to decimal dust shifting the columns over. 5. This is the most import! It looks really pretty!

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#87
post #12

Earlier quoted context omitted.

I think it's a great first effort, but there are a number of possible improvements to do. The most obvious one would be to support passing the file as an argument instead of using cat or the redirection operator every time. It's great that it works with stdin to allow piping into it, but it's cumbersome if you just want to take a file and print it, which will no doubt be a common use case.

Do you think ‘tv I think it’s great for a visualizer like this to encourage people to get used to the power of shell pipelines if possible.

It works, but almost all UNIX commands that work on pipelines can take a list of files as arguments. Out of the commands I use regularly, "patch" is the only one that works exclusively from stdin, probably because file arguments have a different, somewhat obscure, and probably historical meaning.

If appropriate, using files as arguments instead of using shell pipelines is a best practice. Commands can optimize for that use case, print better error messages, etc...

And it is not a good thing to encourage useless use of cat. If you goal is to show how your tool is to be used with pipelines, show an actually useful pipeline for example "sed '1b;/abc/!d' file.csv | tv". The "sed" command prints the first line (header), and all lines containing "abc".

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#88

This looks great. How well does it handle the edge cases of CSV, like escaped commas, quoted text, escaped quotes, and all that fun, fun stuff?

If you come across an edge case that tv does not handle then let me know. I will add a tests csv file as part of the current portfolio of test csvs. https://github.com/alexhallam/tv/tree/main/data

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#89
Hey, great start. I spend half my day in CSVs and I am definitely your target audience. Most of the time I use bat, visidata or tabview. In many ways tabview is the best, though recently the project has been abandoned.

tv looks excellent. Fun name. I think if you added a couple of features it would ascend to my toolbox:

(1) scrolling (horizontal and vertical)

(2) better command line parsing. Running "tv" without stdin or arguments should produce an error/help. Running "tv xyz.csv" should read that file.

Good luck!

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#90

I spend a lot of time in the terminal and want to quickly glance at a csv files without making a new script, opening excel, or using a tui. I made tidy-viewer (tv) because current tools like cat and column were not pretty enough. tv modifies raw files in the following ways: 1. NA detection and highlighting 2. Printing only significant digits 3. Header and footer meta data I have been using this a lot at work. There i…

Man.. TV is such a good name for a visualiser tool that it'd be excellent if it could pretty-print any content given to it. Does your framework support the idea of pre-parsing the file's content and selecting an appropriate renderer, or is it fairly tied to CSVs?

I actually like `tidy` better and honestly would rather have `cat a.csv | tidy ...`. But it's probably already a thing.
Post reply on HN