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.
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.
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!
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).
Comments (136) 27 threads
Earlier commentsWhich is actually worse for screen reader users, I suppose.
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.
a bad example. You shouldn’t need that head in-between.(That makes the example from the header:
However, line 167 says
That seems to indicate this reads the entire file into memory, and that guess wasn’t that educated at all.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!
Continue this thread — 5 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.