Is it possible to extract a particular line from a file knowing its line number? For example, just get the contents of line N as a string from file "text.txt"?
N
You could get it by index from readlines.
readlines
line = IO.readlines("file.txt")[42]
Only use this if it's a small file.
1.4m articles
1.4m replys
5 comments
57.0k users