Print Report Multi-Line Import Difficulties

2 posts / 0 new
Last post
JHDCC
Offline
Joined: 02/15/2017 - 11:28
Print Report Multi-Line Import Difficulties

Hi everyone,
I'm trying to use the print report to import a multi line bank statement. I've attached a redacted example of the source statement.
 
I can almost manage to import the first column using mutli-line, ending on a defined field, however the third transaction with three lines appears as a single line and the fourth line is merged into line 3. I believe this is because of how I set the traps, though I can't see any other way to approach this. See attached "MULTI LINE - FIRST COLUMN ONLY.jpm"
When I add the payment amount (200.00 in these examples), the multi line just cuts off at the first line. I've tried adding this in the base layer, or as it's own layer, but get the same result. See attached "MULTI LINE - INC PAYMENT.jpm"
 
Source Data (as attached in the text file, the pipes are all in the same column)
 
I'm aiming to achieve the below
 
EXAMPLE LINE 1 INFORMATION|TT|200.00||11 MAY 22|||
EXAMPLE LINE 2|TT|200.00||11 MAY 22|||
EXAMPLE LIN E 3 INFO SPLIT OVER 3 LINES|TTT|200.00||11 MAY 22|||
EX 4 SINGLE LINE|TTT|200.00||11 MAY 22|||
 
Is anyone able to advise?
Thanks
 

klmi
Offline
Joined: 02/13/2019 - 08:41

Hi JHDCC,
From my point of view there will be no simple solution with the capabilities of IDEA's Report Reader caused by too less anchors in the print list. I suggest to transform the data with a small Python script:

import os
path = "C:/Users/klmi/Downloads"
file = "EXAMPLE STATEMENT_0.txt"
output = ""
with open(os.path.normpath(os.path.join(path, file)), "r") as f:
    line = f.readline()
    while line:
        if line[29:44].rstrip() == "":
            output = output + line[4:27].rstrip()
        else:
            output = output + line[4:]
        line =  f.readline()
with open(os.path.normpath(os.path.join(path, "output.txt")), "w") as f:
    f.writelines(output)

The script appends the text information in the first column if there's no amount in the second column and generates a new text file with the following output:

EXAMPLE LINE 1 INFORMATION TT | 200.00 | | 11 MAY 22 | ||
EXAMPLELINE 2 TT | 200.00 | | 11 MAY 22 | ||
EXAMPLE LINE 3 INFO SPLITOVER 3 LINES TTT | 200.00 | | 11 MAY 22 | ||
EX 4 SINGLE LINE TTT | 200.00 | | 11 MAY 22 | ||

After that transformation it's also possible to import the data into IDEA as delimiter seperated file by using "|" as delimiter.