3 ms·
There are a few ncurses spreadsheets, including one for Linux which retains a large number of Lotus123 bindings. That said, I find I tend to use awk for tasks
by dredmorbius 9y ago
There are a few ncurses spreadsheets, including one for Linux which retains a large number of Lotus123 bindings.
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.)
- _jal 9y agoI've tried doing that with awk a few times, and find I just haven't written enough to make it non-painful. I did write a ton of Perl at one point, and it seems to have hijacked the associated neurons. 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.
- dredmorbius 9y agoAny programming language with a line- and field-based orientation should do it. Awk is easy because of the implied input loop over the data, and the ability to slice by columns. 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).