Groups
Sign in
Groups
ammonite-scala
Conversations
About
Send feedback
Help
number of lines of a file, without loading all the contents into memory
10 views
Skip to first unread message
David Portabella
unread,
Nov 24, 2017, 4:20:10 AM
11/24/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ammonite-scala
this very compact code tells the number of lines of the file:
val p = root/'tmp/"file.txt read.lines(p).length
however I guess it loads all the content into memory.
is there a way to achieve the same result using ammonite without loading all the content into memory?
Reply all
Reply to author
Forward
0 new messages