bug #6817
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@54674 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0f119c95c1
commit
c8aedee277
|
@ -0,0 +1,48 @@
|
||||||
|
package com.rjconsultores.ventaboletos.utilerias;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class ValidadorImportacaoEcf {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
BufferedReader br;
|
||||||
|
try {
|
||||||
|
br = new BufferedReader(new FileReader("c:\\Users\\Wilian\\Downloads\\fiscal_201604050547.txt"));
|
||||||
|
try {
|
||||||
|
int linha = 1;
|
||||||
|
String line = br.readLine();
|
||||||
|
Integer l1 = null;
|
||||||
|
Integer l2 = null;
|
||||||
|
while (line != null) {
|
||||||
|
if(line.startsWith("1")) {
|
||||||
|
l1 = Integer.valueOf(line.substring(51, 65));
|
||||||
|
l2 = 0;
|
||||||
|
}
|
||||||
|
if(line.startsWith("2")) {
|
||||||
|
l2 += Integer.valueOf(line.substring(47, 62));
|
||||||
|
}
|
||||||
|
line = br.readLine();
|
||||||
|
if(line.startsWith("1") && l1 != null && l2 != null) {
|
||||||
|
if(l1.compareTo(l2) != 0) {
|
||||||
|
System.out.println("Linha: " + linha);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linha++;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
br.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue