Remove lines from a file: Difference between revisions
added Arturo
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Drkameleon (talk | contribs) (added Arturo) |
||
Line 246:
back
</syntaxhighlight>
=={{header|Arturo}}==
<syntaxhighlight lang="arturo">removeFileLines: function [filename, start, cnt][
previous: ø
ensure -> all? @[
exists? filename
previous: read.lines filename
start < size previous
(start + cnt) < size previous
]
final: previous\[0..start-1] ++ previous\[start+cnt..dec size previous]
write filename join.with:"\n" final
]
removeFileLines "myfile.txt" 3 10</syntaxhighlight>
=={{header|AutoHotkey}}==
|