public class demo{
public static void main(String[] args) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter file name for search: ");
String filename = in.readLine();
File file = new File(filename);
if(!filename.endsWith(".txt")){
System.out.println("This is not a text file.");
System.out.println("Please enter file name withe \".txt\" extension.");
System.exit(0);
}
else if(!file.exists()){
System.out.println("File not found.");
System.exit(0);
}
if (splits[j].trim().equals(b)) {
System.out.println("The strings are equal.");
} else {
System.out.println("The strings are unequal.");
}
}
}
System.out.println("Total occurance of the word in the file is: " + a);
}
}
IN this program First I have read a file that I have attach ..i.e "prob.txt" and parse the file according to regular expression and extract 1,2,3...........50 number on prob.txt...and now I want to extract two value given in the bracket (3.84) and [6.64] corresponding to number that we have previosly extract.for example if we have number 1 come then ,extact two value i.e (3.84) and [6.64] corresponding to number 1.other example if we have number 2 come then ,extact two value i.e (5.99) and [9.21] corresponding to number 2.I hope u all understand.plz solve this problem.Thanx in advance..
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.