Read a specific line from a file: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 1,043: | Line 1,043: | ||
print line7$</lang> |
print line7$</lang> |
||
=={{header|Maple}}== |
|||
<lang Maple>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:</lang> |
|||
=={{header|Mathematica}}== |
=={{header|Mathematica}}== |