Reading a complicated text file in Java
<p>Lets say I have a text file like this:</p>

<pre><code>ALASKA             30-DEC-11                                                  
CD  STATION         ICAO  IATA  SYNOP   LAT     LONG   ELEV   M  N  V  U  A  C

AK ADAK NAS PADK  ADK   70454  51 53N  176 39W    4   X     T          7 US

AK AKHIOK           PAKH  AKK 
         56 56N  154 11W   14   X                8 US

AK AMBLER           PAFM  AFM          67 06N  157 51W   88   X                7 US

AK ANAKTUVUK PASS   PAKP  AKP          68 08N  151 44W  642   X                7 US
</code></pre>

<p>I am only interested in saving lines that start with AK.  In addition, I need to save certain information into arrays, like my STATION name for instance.</p>

<p>For the first line I want to store "ADAK NAS" into a stationArray, "51" into an array, same with "53", "N", "176", "39" and "W".  I want to do this for each line that starts with AK.</p>

<p>I'm really quite confused on how to go about this.  My current code pertaining to this is as follows:</p>

<pre><code>//process text file
FileInputStream fstream = new FileInputStream("file.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;

//add lines that start with "AK" to arraylist
ArrayList list = new ArrayList();
while ((strLine = br.readLine()) != null &amp;&amp; strLine.startsWith("AK")) {
    list.add(strLine);
}

Iterator itr;
for (itr=list.iterator(); itr.hasNext(); ) {
    String str = itr.next().toString();
    String [] splitSt =str.split("\\t");
    String junk1 = "\\t";
</code></pre>

<p>I pulled the iterator part from online, and don't know how to split it there, or how do put the respective values into an array.  I'd appreciate any help that you can offer.  Thanks!</p>
