Remove lines from a file: Difference between revisions

m
no edit summary
mNo edit summary
Line 207:
----
</pre>
=={{header|Amazing Hopper}}==
Programming with macro-Hopper:
<lang Amazing Hopper>
#include <hopper.h>
 
main:
.ctrlc
fd=0,fw=0
fopen(OPEN_READ,"archivo.txt")(fd)
if file error?
{"no pude abrir el archivo de lectura: "}
jsub(show error)
else
fcreate(CREATE_NORMAL,"archivoTmp.txt")(fw)
if file error?
{"no pude crear el archivo para escritura: "}
jsub(show error)
else
get arg number(2,desde), // from line
get arg number(3,hasta), // to line
 
line read=0
while( not(feof(fd)))
fread line(1000)(fd), ++line read
if(not( {line read} between(desde, hasta)))
{"\n"}cat,writeline(fw)
endif
wend
endif
endif
fclose(fw)
fclose(fd)
system("mv archivoTmp.txt archivio.txt")
exit(0)
.locals
show error:
file error, println
back
</lang>
=={{header|AutoHotkey}}==
<lang AHK>RemoveLines(filename, startingLine, numOfLines){
543

edits