Read a specific line from a file: Difference between revisions

Content added Content deleted
(→‎{{header|Lasso}}: adding Lasso file read line example)
Line 579: Line 579:
<pre>julia> open(line -> read_nth_lines(line, 7), "path/to/file")
<pre>julia> open(line -> read_nth_lines(line, 7), "path/to/file")
"Hi, I am the content of the seventh line\n"</pre>
"Hi, I am the content of the seventh line\n"</pre>


=={{header|Lasso}}==
<lang Lasso>local(f) = file('unixdict.txt')
handle => { #f->close }
local(this_line = string,line = 0)
#f->forEachLine => {
#line++
#line == 7 ? #this_line = #1
#line == 7 ? loop_abort
}
#this_line // 6th, which is the 7th line in the file
</lang>


=={{header|Liberty BASIC}}==
=={{header|Liberty BASIC}}==