Ask Experts Questions for FREE Help !
Ask
    mflevie44's Avatar
    mflevie44 Posts: 1, Reputation: 1
    New Member
     
    #1

    Oct 5, 2013, 02:29 AM
    Read from text file and store the values
    My file has this kind of records on it

    34.53822859 69.47121593
    -6.235940397 14.21199344
    65.64550476 22.289417
    67.84077199 42.90517872
    24.72956344 63.9792445

    This is my code... I wan to know how can I add the above values in to array list. Or a normal array
    import java.io.*;
    public calss Test
    {
    public static void main(String [] args)
    {
    String file = "";
    //String strMin,strMax;
    double minTemp;
    double maxTemp;
    ArrayList<Double> list = new ArrayList<Double>();
    try
    {
    if(args[0].equals("Temp.txt"))
    {
    file = args[0];
    File myFlie = new File(file);
    FileReader flReader = new FileReader(myFile);

    BufferedReader br = new BufferedReader(flReader);

    String line = br.readLine();

    StringTokennizer st = new StingTokenizer(line,"\t");

    while(st.hasMoreTokens())
    {
    minTemp = Double.parseDouble(st.nextToken());
    maxTemp = Double.parseDouble(st.nextToken());

    list.add()
    }



    }
    }
    catch(Exception ex)
    {
    ex.printStackTrace();
    }
    }
    }

Check out some similar questions!

Arabic text can't be read? [ 1 Answers ]

Hello, Some time I get some weird fonts,like thish - ãä åã ÇáÚãÇÑ. System: Win7-64bt. I already instald additional Arabic Language, and Kurdish, Persian.

Convert image (pdf, typewriter text) to text file [ 21 Answers ]

I've played with 3 different OCR apps (including one that seems to be tops (Abbyy Fine Reader Pro) and find it too much. Easy to use but far too time consuming for my skills with it. See the attached pdf (38 pages of typed text). I have it and 5 others that need converted but am finding it too...

Can a Video file be converted to a understandable text file [ 4 Answers ]

Hi, Can you please let me know if a video file be converted to some readable text file. For example, if we read the text file, we should understand what the video shows and vice versa. Is there any such conversion possible. Please help me in this issue as early as possible.

How to read .reg file in text format [ 0 Answers ]

Hi, I learnt that .ref file is nothing but a text document. Is there a way to programatically read the content in .reg file (line by line) and retrieve information. I appreciate your help. Thanks.

Cannot read text! [ 4 Answers ]

Hello everyone , I run 2005 HP comp. with XP home . Everything has been good until I booted up today . Now all my text is in symbols instead of words . Has anyone ever heard of this ? Thanks for your help, Tom


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.