RosettaCodeData/Task/Read-a-specific-line-from-a-file/Maple/read-a-specific-line-from-a-file.maple
2023-07-01 13:44:08 -04:00

10 lines
295 B
Text

path := "file.txt":
specificLine := proc(path, num)
local i, input:
for i to num do
input := readline(path):
if input = 0 then break; end if:
end do:
if i = num+1 then printf("Line %d, %s", num, input):
elif i <= num then printf ("Line number %d is not reached",num): end if:
end proc: