|
Re: using an index file to print out specific records
|
Posted: Oct 30, 2003 6:18 PM
|
|
sorry I misunderstood ur recLength variable. I guess, the record length varies from record to record. we cannot hardcode it as 113, right.
so, one of the way to handle this is as,
<code>
boolean EOF = false;
while( !EOF ) { try { // your code goes here System.out.println(raf.readUTF()); System.out.println(raf.readInt()); raf.readUTF(); raf.readChar(); System.out.println(raf.readInt()); } catch(EOFException e){ EOF = true; } } </code>
|
|