From c8aedee277d5f3af522c967fcbc502f230e44973 Mon Sep 17 00:00:00 2001 From: wilian Date: Wed, 6 Apr 2016 13:23:05 +0000 Subject: [PATCH] bug #6817 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@54674 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../utilerias/ValidadorImportacaoEcf.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/com/rjconsultores/ventaboletos/utilerias/ValidadorImportacaoEcf.java diff --git a/src/com/rjconsultores/ventaboletos/utilerias/ValidadorImportacaoEcf.java b/src/com/rjconsultores/ventaboletos/utilerias/ValidadorImportacaoEcf.java new file mode 100644 index 000000000..ad1191170 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/ValidadorImportacaoEcf.java @@ -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) { + } + } + +}