Segue um método para exemplo:
private void
lerArquivo()
{ File name = new File("imagens\\TDT.txt"); try{ RandomAccessFile r = new RandomAccessFile(name,"r"); String text; String saida=""; while((text = r.readLine()) != null){ saida += text; } String
d="";
int a,b,c; a=0; b=1; for(int linha=0;linha<34;linha++){ for(int coluna=1;coluna <22;coluna++){ d+=saida.charAt(a); d+=saida.charAt(b); c = Integer.parseInt(d); a+=2; b+=2; d=""; diagTrans[linha][coluna] = c; } } }catch(IOException e2){ veriArquivo = true; } } Luciano Coelho
|
- [java-list] acessando arquivo texto Otávio Barcelos
- Re: [java-list] acessando arquivo texto Clayton
- Re: [java-list] acessando arquivo texto Luciano Coelho
- Re: [java-list] acessando arquivo texto Emilio Yamane