Reading multiple integers from the same line without string manipulation

Numbers as part of a text are not stored the way a number in memory is stored. The process of converting from one representation (text) to the other (memory) is called parsing. You won’t get around doing this on way or another.

If all of your textfiles look like this, you can use CSV.jl (setting the seperator to a space character) or the DelimitedFiles standard library function readdlm (again, setting the seperator to a space character).

5 Likes