• Post Reply Bookmark Topic Watch Topic
  • New Topic

HOW TO READ A NUMERIC VALUE FROM A TEXT FILE  RSS feed

 
Manish Dhasmana
Greenhorn
Posts: 18
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need a solution for my problem.I need to read a numeric value from a text file,such as,cosider a text file with following contents:

The area of the figure
area 23.133
end of file

From this file, I need to read the numeric value of area(23.133) only.How can I get the value of area only from the text file.
Thank you in advance.
 
Norm Radder
Rancher
Posts: 1734
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the first line (text ending with lineend char) and throw it away.
Read the second line, skip the first word and save the second word.
Convert the word to double.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!