0
I have in a txt that is mirror of a tax printer, I would like to take the COO number corresponding only to Z REDUCTION, in the example below would like to catch only the value 031717.
02/01/2014 11:50:06 COO:031717
REDUÇÃO Z
MOVIMENTO DO DIA: 01/01/2014
02/01/2014 11:50:06 COO:031718
LEITURA X
MOVIMENTO DO DIA: 01/01/2014
In my Code I can take all the COO and put in another file, but I would like to take only the Z Reduction.
Follows excerpt from the code:
BufferedReader br = new BufferedReader(new FileReader("arquivo.txt"));
String linha;
while ((linha = br.readLine())!=null) {
String texto="";
if (linha.contains("COO:")) {
texto = linha.substring(linha.length()-6, linha.length());
FileWriter escrever = new FileWriter(new SimpleDateFormat("dd-MM-yyyy").format(new Date())+".txt", true);
escrever.append(texto+"\n");
escrever.close();
}
}
After C00, the next word is always the associated term (Z REDUCTION, X READING, ...)?
– Giuliana Bezerra
Yes, but in a different line
– Marcos Correia