public static void FilterAircraftAddress(String inputDirectory, String outputFile, int aircraftAddress) {
        System.out.println(Calendar.getInstance().getTime());
        System.out.println("Filtering on aircraft address 0x" + String.format("%06X", aircraftAddress));

        System.out.println("Writing output to " + outputFile);
        PrintWriter pw;
        try {
            pw = new PrintWriter(outputFile);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return;
        }

        File directory = new File(inputDirectory);
        File[] files = directory.listFiles();
        System.out.println("Reading input from " + inputDirectory);
        for (File inputFile : files) {
            if (inputFile.getName().endsWith(".txt")) {
                System.out.println("  Processing " + inputFile.getName());

                try {
                    KineticLogFileReader reader = new KineticLogFileReader(inputFile.getAbsolutePath());
                    KineticResponse kineticResponse = reader.read();
                    while (kineticResponse != null) {
                        if (kineticResponse instanceof ModeSAdsbData) {
                            ModeSAdsbData modeSAdsbData = (ModeSAdsbData) kineticResponse;
                            int addressAnnounced = extractInt(modeSAdsbData.getModeSData(), 8, 24);
                            if (addressAnnounced == aircraftAddress) {
                                pw.print(kineticResponse.getTimestamp());
                                pw.print("\t0x");
                                int[] messageData = kineticResponse.getMessageData();
                                for (int p = 0; p < messageData.length; p++)
                                    pw.print(String.format("%02X", messageData[p]));
                                pw.print("\t0x" + String.format("%04X", kineticResponse.getCrc()));
                                pw.println();
                            }
                        }
                        kineticResponse = reader.read();
                    }
                    reader.close();
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        pw.close();

        System.out.println(Calendar.getInstance().getTime());
    }