How do I read a text file of floats into a float Variable?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamebk
    New Member
    • Jun 2010
    • 2

    How do I read a text file of floats into a float Variable?

    I am programming in Java:
    I have a text file full of Float numbers. At least I entered them as numbers. Java see them as lines of Strings. they are each delimited by a space. I want to read each float into a variable and send it to other code to process it.
    The text file contains this.
    Code:
    1319.88 1321.67 1312.22 1320.90 1321.39 1322.04 1322.35 1321.42 1312.34 1321.52 1320.25 1320.98 1320.85 1320.20 1320.63 1321.04 1321.35 1321.81 1322.13 1322.59 1322.16 1321.78 1322.18 1323.23 1322.46 1321.64 1321.31 1320.74 1321.19 1321.77 1322.39 1322.49 1323.21 1323.44 1323.22 1323.18
    I want to process a float variable c = 1319.88 then when the processing is done I want to get the next float c = 1321.67
Working...