10 Mart 2010

Read Text from File with BufferedReader

StringBuffer dataline=new StringBuffer();
try {
BufferedReader br = new BufferedReader(new FileReader(FILE_PATH));

while(br.ready()) {
dataline.append(br.readLine()+";");
}
}
catch(FileNotFoundException fnfe){
System.out.println("Can't open file");
}
catch(Exception e){
e.printStackTrace();
}
String doc=new String(dataline);

Hiç yorum yok: