Lurker News

Comments (136) 27 threads

Earlier comments
semireg3 replies#
Consider adding a code snippet showing a.csv output. I had to watch a video just to see text.
Someone#
And a list of options. Reading the first 80 lines of https://github.com/alexhallam/tv/blob/main/src/main.rs was in some sense more educational than the readme.

It, for example, allowed me to make an educated guess as to the answer to the question “how does this handle huge files?”. It by default only reads 25 lines.
(That makes the example from the header:

   cat diamonds.csv | head -n 35 | tv
a bad example. You shouldn’t need that head in-between.

However, line 167 says

  //.take(row_display_option + 1)
That seems to indicate this reads the entire file into memory, and that guess wasn’t that educated at all.
flusteredBias#
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.
6502nerdface#
A while ago, Two Sigma Investments open-sourced its own curses-based internal tool for pretty printing tabular data: https://github.com/twosigma/ngrid
gurgeous1 reply#
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!

GrayShade4 replies#
Cool project (and written in my favourite language), but I really hate how there's no space at the end of your prompt.
flusteredBias1 reply#
Love the idea! Already opened the issue and will merge a PR before the next release.
flusteredBias#
lol. Got it.
stavros#
I have to agree, I felt dirty watching the recording. The project looks great, though.
BiteCode_dev1 reply#
It feels like when somebody opens a ( but doesn't close it.
hoosieree1 reply#
)
BiteCode_dev#
There is such a big latency in HN for self closing parenthesis.
lambic1 reply#
And the use of cat on a single file..
netcraft1 reply#
I don't understand your comment - could you expand on it?
ComputerGuru5 replies#
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 it instead (e.g. `tv < foo.csv`). At worst, the recipient program would need to buffer the entire contents of the input if it needs to perform non-sequential operations on the source data - this is the case with things like `tac` that need to seek to the end of the input (see https://github.com/neosmart/tac for how `cat foo | tac` requires buffering but both `tac foo` and even `tac < foo` don't).

Continue this thread — 5 replies

Load more comments