(e-mail address removed) schreef:
plz I have a project to read text files and extract data and perform
analysis, so I dont know if ther is any java library readily available
or any techniques or advice or website plz help me
It depends a bit on the format of the text file, but a general approach
would be to read the file using a BufferedReader wrapped around a
FileReader:
BufferedReader reader = new BufferedReader(new
FileReader("inputfile.txt"));
The BufferedReader allows reading the file one line at a time. If no
more lines are available, the readLine() method simply returns 'null':
for (String line = reader.readLine(); line != null; line =
reader.readLine()) {
// Process line
}
To process the line you'll need to use the various available classes
for String manipulation available in Java:
String.split(), String.substring() or StringTokenizer to split the
line in processable parts.
The parse methods in the Number classes to convert number to a
primitive (Integer.parseInt(), ...)
...
Regards,
Bart