Created
October 1, 2013 19:48
-
-
Save matiasfha/6784047 to your computer and use it in GitHub Desktop.
Ejemplo de lectura de archivo en java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StringBuffer texto = new StringBuffer(); | |
try{ | |
FileReader fr = new FileReader("archivo.txt"); | |
entrada = new BufferedReader(fr); | |
String s; | |
while(s = entrada.readLine(fr)){ | |
text.append(s); | |
} | |
entrada.close(); | |
}catch(java.io.FilenotFoundException e){ | |
System.out.println("Archivo no encontrado"); | |
}catch(java.io.IOException e2){} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment