1234567891011121314151617181920212223242526 |
- # BSD 3-Clause 2023 by Kevin Bloom.
- {
- split($0, arr, "<<>>")
- print arr[1]
- total = 0
- split("", entry)
- for(i in arr) {
- if(i > 1) {
- raw = arr[i]
- split(arr[i], entries, " ")
- sub("\\$", "", entries[2])
- entry[entries[1]] += entries[2]
- }
- }
- for(i in entry) {
- total += entry[i]
- # ignore issues with floating point error
- if(total * -1 < 0.01 && total * -1 > 0) {
- total = 0
- }
- if(i != "")
- printf(" %s %.2f %.2f\n", i, entry[i], total)
- }
- }
|