We process M940 bankstatements in our ERP-system but the bank does not provide the statement number in the file (it always states 00001/00001) so I want to put the statement-date where the statement number should be. Each statement has a statement number preceded with code :28C: and a statement date in a line that starts with :60F: such as below.
:28C:00001/00001
:60F:C220315EUR140379,24
:28C:00001/00001
:60F:C220316EUR440379,24
How can I get Powershell to change 00001/00001 into the date coming from the :60F: line right after it? In the real thing there are lines with codes before :28C: and after :60F: and maybe even other codes in between. However, there will always be a :60:-line with the date after a :28C: line.
:28C:220315
:60F:C220315EUR140379,24
:28C:220316
:60F:C220316EUR440579,58
I already have created some powershell script that adds other neccessary substrings and moves it to a directory depending on the bankaccount mentioned in the file but that part of the script is not relevant for this question therefore not stated here.
I would already be very happy with a link that pushes me in the right direction.