Advertisement
pablosotol

Implementacion

Jun 13th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1.  
  2. package implementacion;
  3.  
  4.  
  5. import java.io.BufferedReader;
  6. import java.io.File;
  7. import java.io.FileReader;
  8. import java.io.IOException;
  9. import java.util.ArrayList;
  10. import java.util.List;
  11.  
  12. public class Implementacion {
  13.  
  14.     public static void main(String[] args) {
  15.            String ruta="C:\\Users\\pablo\\Downloads\\133.txt";
  16.            List<String>archivo;
  17.            archivo=leer(ruta);
  18.            for(String linea: archivo){
  19.                for(int i=0;i<linea.length();i++){
  20.                    if(linea.charAt(i)=='.' || linea.charAt(i)=='-' || linea.charAt(i)=='/' || linea.charAt(i)==' '){
  21.                       ATexto at=new ATexto(ruta,archivo);
  22.                    }else{
  23.                       AMorse am=new AMorse(ruta);
  24.                    }
  25.                }
  26.            }
  27.            
  28.     }
  29.    
  30.     public static List<String> leer(String laRuta){
  31.               FileReader fr=null;
  32.               File archivo=null;
  33.               List<String>texto=null;
  34.               String linea;
  35.               try{
  36.                   archivo=new File(laRuta);
  37.                   fr=new FileReader(archivo);
  38.                   BufferedReader br=new BufferedReader(fr);
  39.                   texto=new ArrayList<String>();
  40.                   while((linea=br.readLine())!=null){
  41.                         texto.add(linea);
  42.                   }
  43.               }catch(IOException e){
  44.                   System.out.println(e);
  45.               }finally{
  46.                   try{
  47.                       if(fr!=null){
  48.                          fr.close();
  49.                       }
  50.                   }catch(IOException e){
  51.                       System.out.println(e);
  52.                   }
  53.               }
  54.               return texto;
  55.        }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement