Read a file's lines in Scala 2.7, keeping line terminators -


scala.io.Source strips \ r and \ n getlines I want to put those letters in strings returned.

A similar note says:

Return lines (not including new characters) [...] If you need more refined behaviors, then you need the source # LineEterator I can leave the

I have tried the subtitle lineitor, but I'm having trouble (and possibly plain misconception!).

I want something like this:

Class FullLineEterator () Expands LineIterator {// Do not Strip \ r? \ N Override def getc () = iter.hasNext; & Amp; {Val ch = iter.next if (ch == '\ n') {SB Paragraph B is false} and if (ch == '\ r') {SB epindhy chi (iter.has next and iter.head == '\ n') {iter.next sb adder iter.head} false} Else {sb append ch true}}}

But I pressed a few major problems:
1) The type of linetitle was not found, even if I have import slal. O.Source._
2) I'm pretty sure that I can not reach SB because it's a LineIterator inside [this].

Did anyone want to do this? This is a very strange thing that you want to do, but I want to do it :)

I have peeped at Scalex and there is no fair, there is no luck.

Any suggestions will be received with gratitude. Thank you.

Since you probably only subclass scala.io.Source why getLines override () method and do not return your class Is not overriding LineIterator, but providing you the necessary functionality? However, there is no doubt in it. Comment


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -