Remove lines from a file: Difference between revisions

Content added Content deleted
m (Fix Python solution [for case when the file does not ends with a newline] to prevent removing last character of the file)
(Added 11l)
Line 12: Line 12:
An appropriate message should appear if an attempt is made to remove lines beyond the end of the file.
An appropriate message should appear if an attempt is made to remove lines beyond the end of the file.
<br><br>
<br><br>

=={{header|11l}}==
<lang 11l>:start:
V l = File(:argv[1]).read_lines()
l.del(Int(:argv[2]) - 1 .+ Int(:argv[3]))
File(:argv[1], ‘w’).write(l.join("\n"))</lang>


=={{header|Ada}}==
=={{header|Ada}}==