import java.io.*;
public class CopyRead {
public static void main(String [] args) throws IOException {
// apre il file in lettura
FileReader filein = new FileReader("comune_pescia_tia.txt");
int next;
int x=0,n=0;
char codBollettino, numRata, dataPagamento;
String codB= new String [];
String numR= new String [];
String dP= new String [];
do {
next = filein.read(); // legge il prossimo carattere
if (next != -1) // se non e' finito il file
{
if (x<5) // legge le prime 5 cifre
{codBollettino = (char) next;
codB= codBollettino;
System.out.print(codB); // stampa il carattere
x++;
}
else
{
x=0;
if (x<1) // legge la prima cifra
{
numRata = (char) next;
System.out.print(numRata); // stampa il carattere
x++;
}
else
{
x=0;
if (x<8) // legge le prime 8 cifre
{
dataPagamento = (char) next;
System.out.print(dataPagamento); // stampa il carattere
}
}
}
}
} while (next != -1);
filein.close(); //chiude il file
System.out.println();
}
}