Added info directory.

This commit is contained in:
k1574 2022-08-08 05:52:23 +05:00
parent 68df45da19
commit de5c265e56
4 changed files with 19 additions and 0 deletions

6
info/come.tsv Normal file
View 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
1 Date Type Product Amount Price
2 2022-8-8 Income Init 1 400
3 2022-8-8 Buy Cigs Chapman Green 1 -220
4 2022-8-8 Buy Nachos 1 -60
5 2022-8-8 Buy Jaguar Green 1 -50
6 2022-8-8 Debt Sasha.G 1 500

7
info/count-all.sh Executable file
View 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

View file

@ -0,0 +1,3 @@
BEGIN {cnt = 0}
{if($2 == "Debt") cnt += $4 * $5}
END{print cnt}

View file

@ -0,0 +1,3 @@
BEGIN{cnt = 0}
{cnt += $4 * $5}
END{print cnt}