Show HN: VisiData – vi for data
github.com
github.com
Been wishing for a solid, console-based spreadsheet for a while, but I haven't really gone looking that hard, as I don't use spreadsheets as much as I used to. When I do, though, I find modern GUI spreadsheets want to 'help' way too much and frankly bug the crap out of me. I suppose if I used them more, they'd brainwash me into their 'right' way of doing things, but I generally get fed up and use Postgres. That works surprisingly well for a lot of things, but updating 'cells' via SQL gets tedious, and if I'm trying to get an understanding of the data, a more visual approach is really handy.
Definitely will check this tool out.
That said, I find I tend to use awk for tasks others use spreadsheets for. This gives me the data in a file, and a program I can run against it.
(You can also use a bash script and here documents to feed in data.)
Spending a weekend messing about with awk until I'm comfortable is one line in a very, very long list of things I'll probably never get to.
If you want additional outputs, you simply create them. For a trivial example, if you've got a list of revenues and expenses (say, by month), and want a report with monthly and annual totals (I'll assume only one year is fed, though the example could be expanded:
#!/usr/bin/gawk -f
BEGIN { printf( "%-8s %-8s | %-8s\n", "revenue", "costs", "profit" )}
{
rev = $1; cost = $2; profit = rev - cost;
totrev+=rev; totcost+=cost;
printf( "%8.2f %8.2f | %8.2f\n", rev, cost, profit )
}
END {
printf( "----------------------------\n")
printf( "%8.2f %8.2f | %8.2f\n", totrev, totcost, totrev - totcost )
printf( "============================\n")
}
That's the equivalent of a spreadsheet with columns for revenues, costs, and profits, with a summary line. But you can run it over any annual datasource.Now let me check if that's right.... OK, not too far off, though yes, I'd goofed bits (the first time).
https://github.com/saulpw/visidata/blob/stable/docs/user-gui...
(The link is broken in the docs/README file)
This is the walkthrough on sample data:
https://github.com/saulpw/visidata/blob/develop/docs/tours.r...