By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,654 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,654 IT Pros & Developers. It's quick & easy.

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

P: 2
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.
Expand|Select|Wrap|Line Numbers
  1. 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
Apr 3 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.