To load a text-file, read it line by line, and return the
total number of alphanumeric tokens it contains and skip over the comments and double-quoted strings
in the text-file while you are processing it
BufferedReader fin = new BufferedReader( new InputStreamReader(new FileInputStream("test.txt"),"windows-1251"));
List<String> fileContent = new ArrayList<String>() ;
String str ;
while( (str = fin.readLine() ) != null )
fileContent.add(str) ;
fin.close() ;
To skip over the comments and double-quoted strings
in the text-file while you are processing it, you should use class StringTokenizer
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
JavaJSPJSF