Added info directory.
This commit is contained in:
parent
68df45da19
commit
de5c265e56
4 changed files with 19 additions and 0 deletions
6
info/come.tsv
Normal file
6
info/come.tsv
Normal file
|
@ -0,0 +1,6 @@
|
|||
Date Type Product Amount Price
|
||||
2022-8-8 Income Init 1 400
|
||||
2022-8-8 Buy Cigs Chapman Green 1 -220
|
||||
2022-8-8 Buy Nachos 1 -60
|
||||
2022-8-8 Buy Jaguar Green 1 -50
|
||||
2022-8-8 Debt Sasha.G 1 500
|
|
7
info/count-all.sh
Executable file
7
info/count-all.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
awk="goawk -i tsv"
|
||||
|
||||
echo -n 'Current money: ' ; $awk -f count-current-money.awk come.tsv
|
||||
echo -n 'Current debt: ' ; $awk -f count-current-debt.awk come.tsv
|
||||
|
3
info/count-current-debt.awk
Normal file
3
info/count-current-debt.awk
Normal file
|
@ -0,0 +1,3 @@
|
|||
BEGIN {cnt = 0}
|
||||
{if($2 == "Debt") cnt += $4 * $5}
|
||||
END{print cnt}
|
3
info/count-current-money.awk
Normal file
3
info/count-current-money.awk
Normal file
|
@ -0,0 +1,3 @@
|
|||
BEGIN{cnt = 0}
|
||||
{cnt += $4 * $5}
|
||||
END{print cnt}
|
Loading…
Reference in a new issue