@@ -0,0 +1,1240 @@
+package edu.colorado.cs.tcpstate;%0A%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileWriter;%0Aimport java.io.InputStream;%0Aimport java.util.Scanner;%0A%0Apublic class TcpDumpSplit %7B%0A%0A%09public static void tcpDumpSplit(InputStream tcpdump) %7B%0A%09%09try %7B%0A%09%09%09FileWriter fw = null;%0A%09%09%09String lastPort = null;%0A%09%09%09String line = null;%0A%09%09%09int pos = 0;%0A%09%09%09Scanner s = new Scanner(tcpdump);%0A%09%09%09while(s.hasNext()) %7B%0A%09%09%09%09line = s.nextLine();%0A%09%09%09%09if( line.indexOf(%22%5BS%5D%22) %3E -1 && (pos = line.indexOf(%22%3E%22)) %3E -1) %7B%0A%09%09%09%09%09int start = line.lastIndexOf(%22.%22, pos)+1;%0A%09%09%09%09%09String port = line.substring(start, pos).trim();%0A%09%09%09%09%09if(!port.equals(lastPort)) %7B%0A%09%09%09%09%09%09if(fw != null) %7B%0A%09%09%09%09%09%09%09fw.close();%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09lastPort=port;%0A%09%09%09%09%09%09System.out.println(%22Parsing TCPDUMP for port# %22+port);%0A%09%09%09%09%09%09fw = new FileWriter(new File(port+%22.log%22));%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09if(fw!=null && line.indexOf(lastPort) %3E -1) %7B%0A%09%09%09%09%09fw.write(line+%22%5Cn%22);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09fw.close();%0A%09%09%09s.close();%0A%09%09%09%0A%09%09%7D catch(Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09if(args.length == 1) %7B%0A%09%09%09TcpDumpSplit.tcpDumpSplit(new FileInputStream(args%5B0%5D));%0A%09%09%7D else %7B%0A%09%09%09System.out.println(%22java TcpDumpSplit %5BtcpDumpJoined%5D%22);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add a little app to split up a huge TcpDump file into individual traces