LOCAL PARSER · QUALITY

Bank File Difference Tool

Compare two bank files line by line with whitespace normalization options.

● Browser-only processing

01 / SOURCE

02 / REPORT

Recent history

Method and formulas

A line-oriented longest-common-subsequence comparison reports additions, removals and unchanged lines in local memory.

Use test or appropriately protected data. Parsing is local, but data can still be visible on your screen and in browser memory.

Line comparison is diagnostic, not semantic XML canonicalization.

GUIDE

What This Tool Does

The Bank File Difference Tool performs a line-oriented longest-common-subsequence comparison between two bank files. It identifies additions, removals, and unchanged lines while offering an optional whitespace normalization step that collapses multiple spaces and trims leading or trailing blanks before comparison. Bank files in formats such as SWIFT MT940 contain structured records that include transaction references, account identifiers, and balance statements; even minor formatting variations can obscure genuine changes in amounts or dates. This tool is intended for reconciliation tasks where an analyst needs to verify that two versions of the same statement differ only in expected ways, for example after a correction by the bank or after manual editing. Because processing occurs entirely within the browser, no data leaves the local session. The output highlights each line with a status indicator so that users can quickly locate discrepancies without manual side-by-side reading.

Users typically invoke the tool after exporting two versions of a daily bank statement from separate sources, such as a core banking system and a third-party reconciliation platform. The comparison reveals whether a balance figure has been altered, whether a reference field has been updated, or whether entire blocks of transactions have been inserted or deleted. The whitespace option proves useful when one file contains extra padding introduced by fixed-width export routines while the other does not. By focusing strictly on line sequences rather than semantic parsing, the tool remains lightweight and avoids assumptions about field ordering that might not hold across all bank formats.

Worked Example

Consider two short excerpts from MT940 statements. The original file contains the lines :20:REF-A, :25:ACCOUNT-1, and :62F:C260723EUR100,00 while the comparison file contains :20:REF-A, :25:ACCOUNT-1, and :62F:C260723EUR90,00. After enabling whitespace normalization the tool reports the first two lines as unchanged and flags the third line as a removal paired with an addition of the line carrying the new balance of EUR90,00. A table representation of the result shows each line alongside its status and the normalized text used for matching.

LineOriginalComparisonStatus
1:20:REF-A:20:REF-Aunchanged
2:25:ACCOUNT-1:25:ACCOUNT-1unchanged
3:62F:C260723EUR100,00:62F:C260723EUR90,00removed / added

The numeric difference of EUR10,00 is immediately visible once the lines are aligned. Extending the example to a full statement with fifty lines demonstrates how the algorithm correctly isolates a single changed balance line among many identical transaction records.

Comparison Method

InputDescriptionUnit / FormatOutput
contentAOriginal bank file textplain text linessequence of tokens after normalization
contentBComparison bank file textplain text linessequence of tokens after normalization
ignoreSpaceBoolean flag for whitespace collapseyes / noadjusted token sequences
LCS resultLongest common subsequenceline indicesadded, removed, unchanged labels

The algorithm first splits each textarea into an array of lines. When ignoreSpace is set to yes, each line is passed through a normalization function that replaces runs of whitespace with a single space and removes leading and trailing blanks. The normalized arrays are then fed to a standard longest-common-subsequence routine that returns matching indices. Lines present only in the first array are marked removed, lines present only in the second array are marked added, and shared lines are marked unchanged. No currency conversion or amount arithmetic is performed; the tool reports textual differences only.

Units and Conversions Notes

Bank files commonly express amounts with a comma as the decimal separator and a period as the thousands separator, for example 1.234,56. Dates follow the YYMMDD convention inside field :62F:. The tool does not interpret these values numerically and therefore performs no conversion between comma and period formats. Users who require numeric reconciliation must copy the differing lines into a separate calculation utility. Currency codes such as EUR or USD appear as literal text and are compared character by character after normalization.

Limitations

Because the comparison remains strictly line-based, it cannot detect semantic equivalence when the same information is reordered or reformatted across multiple lines. XML canonicalization or field-level parsing is outside the scope of this diagnostic utility. Large files exceeding several thousand lines may cause noticeable browser memory usage, although the computation itself stays local. The tool does not validate SWIFT syntax or checksums; malformed records are compared exactly as supplied.

Common Mistakes

Analysts sometimes forget to enable the whitespace option when one export contains trailing spaces from fixed-length records, resulting in every line appearing different. Another frequent error is pasting production data containing account numbers into the textareas without first masking sensitive values. Users also occasionally misread the output when a single balance line changes, expecting the tool to compute the numeric delta rather than simply flag the textual difference. Finally, comparing files that use different character encodings can produce spurious additions and removals at the start of each line; converting both files to UTF-8 before import avoids this issue.

Frequently asked questions

How does the tool handle lines that differ only by trailing spaces when ignoreSpace is disabled?

Each line is compared exactly as entered, so trailing spaces cause the lines to be treated as distinct. The result marks one occurrence removed and the other added even though the visible content appears identical.

What happens if a bank file uses CRLF line endings while the second file uses LF only?

The browser normalizes line endings to LF during textarea parsing, therefore the comparison proceeds on the logical lines without reporting spurious differences caused by carriage returns.

Can the tool detect that EUR100,00 and 100.00 EUR represent the same amount after different formatting?

No. The comparison operates on normalized text strings only and performs no numeric parsing or currency symbol repositioning, so the two representations are reported as different.

Is there a limit on the number of lines that can be processed in a single browser session?

Practical limits depend on available memory; files with more than approximately 5000 lines may slow the longest-common-subsequence calculation or trigger browser warnings about script execution time.

Does enabling ignoreSpace affect the display of the original and comparison columns in the result table?

Normalization is used solely for matching decisions. The result table always shows the original, unnormalized text from each textarea so that users can verify exact content.

How should an analyst verify that a changed balance line actually reflects a legitimate bank correction rather than an error?

After identifying the differing line, the analyst should cross-check the preceding and following transaction blocks against the bank portal or original source documents, because the tool only surfaces textual variance and supplies no audit trail.

What occurs when one file contains duplicate consecutive lines and the other omits one instance?

The longest-common-subsequence algorithm matches the maximum number of identical lines, leaving the unmatched duplicate marked as removed or added depending on which file contains the extra copy.

Are date fields such as 260723 compared as text or interpreted as calendar dates?

Dates are compared strictly as character sequences after whitespace normalization. No calendar validation or chronological ordering is applied during the line comparison.