G
Guest
Gast
Der Aufruf der Methode "fuellArray" funktioniert nicht...
Die Methode fuellArray enthält noch keinen Code. Hier möchte ich anschlissend eine Datei lesen und eine Array füllen
Die Methode fuellArray enthält noch keinen Code. Hier möchte ich anschlissend eine Datei lesen und eine Array füllen
Code:
import java.io.*;
public class AfiRead3
{
// Fülle Array
public void fuelleArray()
{
}
// Public AfiRead3
public AfiRead3()
{
try
{
BufferedReader in = new BufferedReader(new FileReader("AFI.DE1"));
String satz, inno, strmano;
int idx;
while((satz = in.readLine()) != null) // Loop1
{
try
{
strmano = satz.substring(6,12);
if (strmano.equals("A MANO"))
{
idx = 1;
inno = satz.substring(13,19);
System.out.println("Objekt: " + satz);
while((satz = in.readLine()) != null) // Loop 2
{
try
{
strmano = satz.substring(6,12);
}
catch(StringIndexOutOfBoundsException s)
{
// System.out.println("Fehler bei SubString!" + satz);
}
// satz = in.readLine();
System.out.println(idx + " " + satz);
idx ++;
if (strmano.equals("E MANO"))
{
break;
}
}
// End Loop Read Detail Records
System.out.println("E N D E: " + "Objekt: " + inno + "-----------");
System.out.println(" ");
}
}
catch(StringIndexOutOfBoundsException s)
{
//System.out.println("Fehler bei SubString!");
}
}
}
catch(FileNotFoundException fnfe)
{
System.out.println("Datei nicht gefunden!");
}
catch(IOException ioe)
{
System.out.println("Fehler beim Lesen!");
}
}
// Main
public static void main(String[] args)
{
fuelleArray();
AfiRead3 dl = new AfiRead3();
}
}