project123
11-28-2006, 03:53 AM
hi,
i was wondering how can i select n display only certain items from the text file. lets say i have name , address, birthdate, location in the file.
However, i would only like to retrieve the address. how can i do that? thanks
currently i have managed to select out all the info by using this following codes.
File inputFile = new File("C:\\temp\\test.txt");
try{
FileReader in= new FileReader(inputFile);
int c;
String str;
while ((c = in.read()) != -1) {
System.out.print((char) c);
}
in.close();
}catch (FileNotFoundException e){
System.out.println("File Does not exist");
System.exit(1);
i was wondering how can i select n display only certain items from the text file. lets say i have name , address, birthdate, location in the file.
However, i would only like to retrieve the address. how can i do that? thanks
currently i have managed to select out all the info by using this following codes.
File inputFile = new File("C:\\temp\\test.txt");
try{
FileReader in= new FileReader(inputFile);
int c;
String str;
while ((c = in.read()) != -1) {
System.out.print((char) c);
}
in.close();
}catch (FileNotFoundException e){
System.out.println("File Does not exist");
System.exit(1);