Hi, I have a problem with my instance. I need to do a file read to extract all the numbers in the text file. However, when reading the file, I used String, and hence the file is read as a String. Later on I need to equate the output of the file read to a double. I have this error here, String and double cannot be equate to each other. May I know how to read the file using double instead of String?
The part where I read the file:
try
{
BufferedReader in = new BufferedReader(new FileReader("C:\\Users\\Serene\\Documents\\Major Project\\Alignment Algorithms\\RMSDscores.txt")); //reading files in specified directory
[B]String[/B] str;
while ((str = in.readLine()) != null) //file reading
{
display = str;
System.out.print(display);
}
in.close();
}catch( IOException ioException ) {}
The bolded part is the part where String is used to read the file. However I need to read it as a double. May I know how to do it?