Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

reading floats from file  RSS feed

 
Patrick ODonnell
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have a text file as follows:
-0.891
0.893
1.022
.
.
i.e. a list of numbers.
I want to be able to read in each line and store it in a float[] array, so i can perform some math operations on it. how do I do this.
Thanks,
Patrick.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't crosspost - people will waste their time giving duplicate answers. I/O was the right forum for this.
- Peter
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!