The file is very large so I cannot store in memory. I iterate line by line as follows
for (line <- Source.fromFile(file).getLines) {
}
How can I specify that the first line should be skipped?
How about:
for (line <- Source.fromFile(file).getLines.drop(1)) {
// ...
}
drop
will simply advance the iterator (returned by getLines
) past the specified number of elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With