Live data from Hacker News

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

github.com

51–60 of 141 posts

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

#51

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…

Hey, if you are able to edit the title of this submission, can you add `Show HN: ` prefix?

See https://news.ycombinator.com/showhn.html for details.

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

#53

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…

Cool project! I'm familiar with column, and this looks like a good replacement. Curious, how do you handle formatting on cells with long strings that need to overflow to multiple lines? As soon as you try to optimize the column widths for table length, you start hitting an NP-hard problem. https://quintenkent.com/content/column-problem.html

I actually read that article when I started making the package. You can see some of the input data here https://github.com/alexhallam/tv/blob/main/data/a.csv. I let the user chose how long the max column width should me then append "...". The default value is 20 characters.

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

#54

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.

Maybe you could just background highlight the empty cells?

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

#55
Demo looks great, alas the prebuilt binaries don't work

  $ wget https://github.com/alexhallam/tv/releases/download/0.0.10/tidy-viewer
  --2021-09-27 16:47:43--  https://github.com/alexhallam/tv/releases/download/0.0.10/tidy-viewer
  Resolving github.com (github.com)... 140.82.121.3
  Connecting to github.com (github.com)|140.82.121.3|:443... connected.
  HTTP request sent, awaiting response... 404 Not Found
  2021-09-27 16:47:44 ERROR 404: Not Found.

The deb in https://github.com/alexhallam/tv/target doesn't exist either

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

#56

Cool project (and written in my favourite language), but I really hate how there's no space at the end of your prompt.

It feels like when somebody opens a ( but doesn't close it.

)

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

#57
post #55

Demo looks great, alas the prebuilt binaries don't work $ wget https://github.com/alexhallam/tv/releases/download/0.0.10/tidy-viewer --2021-09-27 16:47:43-- https://github.com/alexhallam/tv/releases/download/0.0.10/tidy-viewer Resolving github.com (github.com)... 140.82.121.3 Connecting to github.com (github.com)|140.82.121.3|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2021-09-27 16:47:44…

1. Looks like you are using 0.0.10 the current version is 0.0.13

2. I need to update the README the binaries are here https://github.com/alexhallam/tv/releases/tag/0.0.13

I recently moved away from manually building binaries to automated building for many architectures. I am still learning how to use github actions to build for a matrix of architectures. I am still learning.

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

#58

Earlier quoted context omitted.

cat just regurgitates the contents of the file, but the resulting piped fd is non-seekable. Since almost every command that can operate on a file from stdin can also operate on the file by name/path, at best this is just a needless invocation of a process (i.e. `tv foo.csv` should have been used instead of `cat foo.csv | tv`) - if the app in question can't handle paths, then you can have the shell pipe the file into…

thank you! I knew some of that but learned a lot too.

Google the phrase "useless use of cat".

To some, it's a faux-pas. Personally, I like the aesthetics of cat for my own scripts. It follows the "pipe flowing" idiom better.

There are performance reasons why "useless cat" should be avoided though. So avoid it where performance is important (or when some other hardcore CLI jockey is going to see your code :))

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

#59

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…

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.

When presented with a similar problem, I tend to use non-ascii characters. For example, in my `~/.psqlrc` I have:

    \pset null ␀
Looks like this in output:

    40 |       ␀ | 2021-09-23 20:42:32.536571 | ␀
    41 |      15 | 2021-09-23 20:42:33.177474 | ␀
    42 |      19 | 2021-09-23 20:42:33.212133 | ␀
    43 |       ␀ | 2021-09-23 20:42:33.247346 | ␀

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

#60

Earlier quoted context omitted.

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.

Maybe you could just background highlight the empty cells?

Well, I think being promiscuous with "NA", "N/A", nan, etc. is a separate issue from a blank cell. A blank cell is literally missing. That should be filled with NA.
Post reply on HN