I want to write a program that reads this file and writes its contents along with line numbers to another file. I wrote the following program:
function readwrite()
inn = open("input.txt","r")
out = open("output.txt","w")
counter = 0
while !eof(inn)
r = readline(inn)
counter +=1
println(out, counter,": ",r)
end
close(inn)
close(out)
end
readwrite()
This program works fine, but does not work with the following command:
(It might be clearer to call C (or c) a ‘digit’ in this context, not to be confused with the character 'C' with ASCII code 67 in decimal (0x43 hexadecimal) )