You have chosen to sponsor your bid up to a maximum amount of .
I need a simple script that will read files in the format of "source.txt" attached.
From this file, the transactions need to be read, and the output reformatted to csv.
You will need to read through the source.txt file until you get to "Statement Opening Balance" then read the amount after this. The transactions to be output follow this between lines of "......".
For each transaction you need to extract the date, and then the description, and then the transaction amount, and then the new balance. Using the transaction amount and the previous balance and the new balance you will need to determine if the amount is a debit (reduced the balance) or credit (increased the balance).
The transactions should be read until you reach "CLOSING BALANCE"
The output file will be in CSV, and in the following format:
Bank Account,Date, Description, Debit Amount, Credit Amount
The bank account will be the same for every line and will be able to be determined from the text at the start of source.txt by reading the line under "BSB Account Number" and removing any "-" or " ".
The date will need to be changed from the source.txt file being in "DD MMM" format, to DD/MM/YY when output to the csv. The year can be determined from the line that included "Statement Opening Balance".
The script should allow for the source file to be uploaded by the user and the output csv to be downloaded.