I'm a new user of Nim. I'm enjoying programming in it. It's an exceptionally 
elegant language.

But, currently I'm stuck with a problem: I haven't been able to find a way to 
read numbers (floats, ints, etc.) from an ASCII (text) file.

As a concrete example, suppose we have a text file like

3.14 2 41.00

where numbers are written in a blank-separated ASCII format. So, I'm looking 
for a function that reads the text file, parse it, and convert the 
text-representations of the numbers into the corresponding numbers, like C's 
scanf, C++'s ">>", Fortran's formatted read, etc. Or something like Ruby's 
String::to_f method or Haskell's "read" function.

Thank you for your help.

Ryo 

Reply via email to