Jump to content

Read a file line by line: Difference between revisions

m
no edit summary
mNo edit summary
Line 352:
21: done: SKIP
</pre>
=={{header|Amazing Hopper}}==
<lang Amazing Hopper>
#include <hopper.h>
 
main:
.ctrlc
fd=0
fopen(OPEN_READ,"archivo.txt")(fd)
if file error?
{"Error open file: "},file error
else
line read=0
while( not(feof(fd)))
fread line(1000)(fd), ++line read
println
wend
{"Total read lines : ",line read}
fclose(fd)
endif
println
exit(0)
</lang>
{{out}}
<pre>
RX/RY,A,B,C,D,E,F,G,H,I,J
fila 1,1,2,3,4,5,6,7.998,8,9.034,10
fila 2,10,20,30,40,50,60,70,80,90,100
fila 3,100,200,300.5,400,500,600,700,800,900,1000
fila 4,5,10,15,20,25,30,35,40,45,50
fila 5,a,b,c,d,e,f,g,h,i,j
fila 6,1,2,3,4,5,6,7,8,9,10
Total read lines : 7
</pre>
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi}}
545

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.