Get values from text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zeinz
    New Member
    • Feb 2012
    • 7

    Get values from text file

    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,,
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Read http://bytes.com/topic/java/insights...-writing-files

    Comment

    • zeinz
      New Member
      • Feb 2012
      • 7

      #3
      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 ?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        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.

        Comment

        • zeinz
          New Member
          • Feb 2012
          • 7

          #5
          Simply U R a GREaT :))
          I'm very Thankful, it's works :D

          Comment

          Working...