https://kotlinlang.org logo
Title
d

duncanconroy

06/15/2017, 2:16 PM
Hi there, I'm new to Kotlin and currently writing a text file parser. I've come across the useful function File.forEachLine. What I want to do know, is to print out the progress of file reading, e.g. by getting the current file pointer. It seems that I can neither access the InputStream, which is used inside the forEachLine function, nor can I find another way of getting the current position in the file. Does someone know how I can get file position or currentLine / totalLines within forEachLine? Thanks in advance!
i

ilya.gorbunov

06/15/2017, 2:32 PM
duncanconroy: This answer might help https://stackoverflow.com/a/30716533/869184
d

duncanconroy

06/16/2017, 7:19 AM
thx! I'll check that out