When i trying parse txt file at 200k line in file i have this error:
java.nio.charset.UnmappableCharacterException: Input length = 1
After i got error my program break:
val bufferedSource = io.Source.fromFile( path)
for (line <- bufferedSource.getLines.drop(1)) {
line.split('|').toList.drop(1)
}
If I understand correctly, the error is in io.Source.fromFile( path).
How i can skip bad rows ?
import scala.io.Codec implicit val codec = Codec("cp1251") codec.onMalformedInput(CodingErrorAction.REPLACE) codec.onUnmappableCharacter(CodingErrorAction.REPLACE)