forked from insensitiveclod/drink_orders-analysis_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.FIRST
55 lines (36 loc) · 2.48 KB
/
README.FIRST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
The file 'README' contains all the information required to understand the tool and it's inner workings.
BUT
If you just want to run an analysis over the drink-orders as you have received them or edited them, this is a short-cut guide:
- Add pdf/csv/order-summary-entries as described in "README"
- rm analysis_info/order*
- ./parse_all.sh > textual_info
Done.
You will now have freshly made CSV files in analysis_info made from new/updated input-data
If you do not care about the produced CSV's but just want some 'quick ansers', you can use the 'textual_info' output to read in "normal english" just how much profit/costs/etc there were per order, per product.
Short-cut shell-magic examples:
Produce output that should match up with the amounts in order_info/order-summary
------
echo "EX VAT|INC VAT";grep "TOTAL" analysis_info/* | cut -f5,7 -d"|"
------
Return list of all the individual manufacterer/product combinations we have used so far:
------
cd order_info/csv; cut -f1,2 -d"|" * | sort | uniq
------
For each order ever made, give a succint CSV that lists the most relevant stats, with a column-heading included:
------
for i in `cd analysis_info; ls analysis*`; do echo ===== $i =====; echo "Manufacturer|Product|Cost INC VAT|Income|Profit|Profit%"; cut -d"|" -f1,2,7,12,13,14,15 analysis_info/$i; echo ; done
------
For each order ever made, return how many bottles the order had of which product. Note it also returns crate-deposits and such, but these dont get counted in the bottle-totals for each order:
------
for i in `cd analysis_info; ls analysis*`; do echo ===== $i =====; echo "Manufacturer|Product|Bottles"; cut -d"|" -f1,2,8 analysis_info/$i; echo ; done
------
For each order ever made, return how much it cost (inc vat), profit percentage, total income, total profit
------
for i in `cd analysis_info; ls analysis*`; do echo ===== $i =====; echo "Order cost (inc vat)|order profit percentage|order income|order profit"; grep -i "ORDER" analysis_info/$i | cut -d"|" -f7,11,12,13,11 ; echo ; done
------
Produce a list of all order-date+manufacter+product combinations and list the SALES-PRICE and PROFIT-PERCENTAGE made on that product at that time; excluding 'statiegeld'
------
echo "Order:Manufacterer|Product|Sales-Price|profit%"; cd analysis_info; for i in `ls analysis*`; do grep -v -H -i 'TOTAL' $i | grep -v -i "statiegeld" | cut -f"1,6,2,11" -d"|"; done | sort -n -t"|" -k 3
------
Etc etc.
This gives you an idea of what kind of data is in the csv's and what can be done with them.