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..
1. Do not start several threads about one problem
2. Please use [code] tags when pasting code
3. The answer is here
Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?
I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S(from: bash.org.ru)
//always looking for job opportunities in AU/NZ/US/CA/Europe :P
willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL")); USE [code] TAGS!Read this FAQ if you are new here. If this post was helpful, please rate it!
* 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.