Fixed Mt940Parser line separator
This commit is contained in:
parent
d27fecc8c3
commit
d894419de7
|
@ -75,7 +75,8 @@ open class Mt940Parser : IMt940Parser {
|
||||||
protected open fun splitIntoSingleAccountStatements(mt940String: String): List<String> {
|
protected open fun splitIntoSingleAccountStatements(mt940String: String): List<String> {
|
||||||
val accountStatements = mutableListOf<String>()
|
val accountStatements = mutableListOf<String>()
|
||||||
|
|
||||||
val lines = mt940String.split("\n")
|
// MT940 line separator is "\r\n", but i added also "\n" and "\r" cause if parsed from file on Linux or MacOS these are the line separators there
|
||||||
|
val lines = mt940String.split("\r\n", "\n", "\r")
|
||||||
var lastMatchedLine = 0
|
var lastMatchedLine = 0
|
||||||
lines.forEachIndexed { index, line ->
|
lines.forEachIndexed { index, line ->
|
||||||
if (line == "-") {
|
if (line == "-") {
|
||||||
|
|
Loading…
Reference in New Issue