Read a specific line from a file: Difference between revisions

Content added Content deleted
(PascalABC.NET)
(Add ed example)
 
Line 770: Line 770:
Readln;
Readln;
end.</syntaxhighlight>
end.</syntaxhighlight>

=={{header|ed}}==

ed works on files by default, so all that's needed to read the seventh line is addressing it. In case there's no such line, a useful error message is printed by ed itself, with no effort on the programmer side.

<syntaxhighlight lang="sed">
# by Artyom Bologov
H
7p
Q
</syntaxhighlight>


=={{header|Elixir}}==
=={{header|Elixir}}==