4 ms·
I like this idea. I don't think it would be jarring if the read-ahead buffer was a minimal number of lines, i.e. looking like distinct pages. The default could
by eevilspock 5y ago
I like this idea. I don't think it would be jarring if the read-ahead buffer was a minimal number of lines, i.e. looking like distinct pages. The default could be at least the line height of the terminal, or some multiple.
There could be an option to redisplay the header row for resized "pages".
There could be a CLI switch giving the user control, i.e. make everyone happy.
- killjoywashere 5y agoI think data scientists will recognize this problem, and there's a well-used solution: .head() Just show me the top 5 rows. That's all most people are looking for. cat data/a.csv | tv --head
- fiddlerwoaroof 5y agoOr: head -n5 data/a.csv | tv
- eli 5y agoUnless your csv has embedded line breaks
- flusteredBias 5y agoCan you give an example of what you mean? If it breaks tv then I would like to add it to the automated tests and see if we can work on it.
- eli 5y agoNo sorry, I assume tv is fine. The problem is in assuming `head -n5` gives you 5 rows and piping that into tv.
- flusteredBias 5y agoOo I see. Thanks for clarifying.
- IncRnd 5y agoIf tv works with embedded EOLs, you can do this: cat data/a.csv | tv | head -n5 It is more resource intensive, but it pushes the problem you mentioned onto tv. If tv doesn't work with embedded EOLs, then you need to fix your data or fix your tool.
- franga2000 5y ago> Just show me the top 5 rows. That's all most people are looking for. Is it? I'd wager that can't be more than half its use at most. Accessing a specific section that could be at any section of the file is very common in my experience, as is truly random access. Both of these, as well as the first few rows use case, are far better served by a page system.