I have a file with debit credit and withdrawal transactions. I need a bash script that records the balance after every transaction. So file is like this:
D:11/02/12:1000.50 C:11/03/12:300 W:11/05/12:95.50 D:11/10/12:125 C:11/20/12:265.50
where D = debit, C = credit, and W = withdrawal
The output needs to be like this:
11/02/12 1000.50 11/03/12 700.50 11/05/12 605.00
and so on. I have done it in
awk and but cannot figure that out how to write in
Any advice or sample would be greatly appreciated.