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

Get values from text file

P: 7
Hi,

I'm working on a graduation project that i need to get values from a text file (generated by labview) & plot them on a graph.

i want to get the values in the text to an array to use it later.

the text file format is like following:

0.152 0.475 0.489 0.178 0.477 0.413
0.456 0.487 0.489 0.472 0.137 0.175
0.489 0.157 0.178 ...

& all this values is actually one line not several lines.

so, i want a way to read this long line as first float then store it into array then read second float, store it & so on.



Thanks In advance,,
Feb 20 '12 #1

✓ answered by r035198x

How are the numbers separated in the file?
If they are separated by a space then do line.spilt("\\s") to get the numbers into a String array.

Share this Question
Share on Google+
4 Replies


P: 7
okey sir,
i can read\write files already but i want to access the file value by value then store it into an array.

is there any method to take the first float number in the line then the second & so on ?
Feb 20 '12 #3

10K+
P: 13,264
How are the numbers separated in the file?
If they are separated by a space then do line.spilt("\\s") to get the numbers into a String array.
Feb 20 '12 #4

P: 7
Simply U R a GREaT :))
I'm very Thankful, it's works :D
Feb 20 '12 #5

Post your reply

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