Skip to content

Instantly share code, notes, and snippets.

@fitorec
Created October 30, 2009 04:15
Show Gist options
  • Save fitorec/222113 to your computer and use it in GitHub Desktop.
Save fitorec/222113 to your computer and use it in GitHub Desktop.
//Ejemplo simple de lectura de archivos !!!
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;
public class FileReader{
public static void main(String[] args) throws IOException {
BufferedReader entrada;
File archivo = new File("/home/alumnos/Descargas/puntos.txt");
try {
entrada = new BufferedReader( new FileReader( archivo ) );
while(entrada.ready()){
System.out.println(entrada.readLine());
}
}catch(Exception e){
System.out.println("error "+e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment