Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package implementacion;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.ArrayList;
- import java.util.List;
- public class Implementacion {
- public static void main(String[] args) {
- String ruta="C:\\Users\\pablo\\Downloads\\133.txt";
- List<String>archivo;
- archivo=leer(ruta);
- for(String linea: archivo){
- for(int i=0;i<linea.length();i++){
- if(linea.charAt(i)=='.' || linea.charAt(i)=='-' || linea.charAt(i)=='/' || linea.charAt(i)==' '){
- ATexto at=new ATexto(ruta,archivo);
- }else{
- AMorse am=new AMorse(ruta);
- }
- }
- }
- }
- public static List<String> leer(String laRuta){
- FileReader fr=null;
- File archivo=null;
- List<String>texto=null;
- String linea;
- try{
- archivo=new File(laRuta);
- fr=new FileReader(archivo);
- BufferedReader br=new BufferedReader(fr);
- texto=new ArrayList<String>();
- while((linea=br.readLine())!=null){
- texto.add(linea);
- }
- }catch(IOException e){
- System.out.println(e);
- }finally{
- try{
- if(fr!=null){
- fr.close();
- }
- }catch(IOException e){
- System.out.println(e);
- }
- }
- return texto;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement