public class StatistikWerteLesen {
public static String Hersteller = null;
public static String Geraete_typ = null;
public static String Hallen_nr = null;
public static String Hallen_nr1 = null;
public static String Geraete_nr = null;
public static String Zulassungs_nr = null;
public static String Bauart = null;
public static String Streifen_nr = null;
public static String Kass_datum = null;
public static String KassLe_datum = null;
public static String Einwurf_sum = null;
public static String Auswurf_sum = null;
public static String Saldo1_sum = null;
public static String EKkasse_sum = null;
public static String Saldo2_sum = null;
public static String dateiWGS = null;
public static String[] firmaList;
public static Thread t = new Thread();
public StatistikWerteLesen() throws Exception {
String[] dateiInhalte = EinLesenStreifenInhalt.dateiInhalte;
String[] dateiNamen = EinLesenStreifenNamen.dateiListe;
String Verz = DatenImport.Verz + "\\";
long long_hersteller = 0L;
long long_geraetetyp = 0L;
long long_hallennr = 0L;
long long_geraetenr = 0L;
long long_zulassungsnr = 0L;
long long_bauart = 0L;
long long_streifennr = 0L;
long long_kassdatum = 0L;
long long_kassdatumle = 0L;
long long_einwurf = 0L;
long long_auswurf = 0L;
long long_saldo1 = 0L;
long long_ekkasse = 0L;
long long_saldo2 = 0L;
getDBFirmen();
for (int i = 0; i < dateiInhalte.length; i++ ) {
final String dateiName = dateiNamen[i];
final String dateiInhalt = dateiInhalte[i];
File file = new File(Verz + dateiNamen[i]);
RandomAccessFile raf = null;
try {
raf = new RandomAccessFile(file, "r");
String line = null;
while ((line = raf.readLine()) != null) {
if (line.contains("\033K!")) {
long_hersteller = raf.getFilePointer();
}
if (line.contains("\033K\"")) {
long_geraetetyp = raf.getFilePointer();
}
if (line.contains("\033K#")) {
long_hallennr = raf.getFilePointer();
}
if (line.contains("\033K$")) {
long_geraetenr = raf.getFilePointer();
}
if (line.contains("\033KC")) {
long_zulassungsnr = raf.getFilePointer();
}
if (line.contains("\033K)")) {
long_bauart = raf.getFilePointer();
}
if (line.contains("\033K%")) {
long_streifennr = raf.getFilePointer();
}
if (line.contains("\033K&")) {
long_kassdatum = raf.getFilePointer();
}
if (line.contains("\033K'")) {
long_kassdatumle = raf.getFilePointer();
}
if (line.contains("\033KQ")) {
long_einwurf = raf.getFilePointer();
}
if (line.contains("\033KR")) {
long_auswurf = raf.getFilePointer();
}
if (line.contains("\033KS")) {
long_saldo1 = raf.getFilePointer();
}
if (line.contains("\033KB")) {
long_ekkasse = raf.getFilePointer();
}
if (line.contains("\033KX")) {
long_saldo2 = raf.getFilePointer();
break;
}
}
raf.seek(long_hersteller);
line = raf.readLine();
if (line.contains("GEWETE")) {
}else{
Hersteller = line;
raf.seek(long_geraetetyp);
line = raf.readLine();
Geraete_typ = line;
raf.seek(long_hallennr);
line = raf.readLine();
line = line.substring(15, 24);
line = line.replaceFirst("0+", "").trim();
System.out.println(line.length());
if(line.length() == 0){
new FirmaAuswahl(dateiName);
Thread.sleep( 4000 );
// das mit dem Thread.sleep funktioniert gefällt mir aber nicht
// weil das Auswahl Fenster beim nächsten mal überschrieben wird
// hier an dieser Stelle soll die Klasse FirmaAuswahl aufgerufen werden
// und hier soll es erst weiter gehen wenn eine Firma ausgewählt wurde
//
}
if(line.length() > 0 ){
raf.seek(long_hallennr);
line = raf.readLine();
line = line.substring(15, 24);
line = line.replaceFirst("0+", "").trim();
Hallen_nr = line;