Reading lines beyon null lines in a file

While writing a file-processing script, I came across the following case where I need

to read info like ENDDOC and PGCount for multiple records that are in the same file.

; Record 1

@C ENDDOC# ATYC-12769314

@C PGCount 20

@T ATYC-12769295

; Record 2

@C ENDDOC# ATYC-12769317

@C PGCount 3

@T ATYC-12769315

Can you suggest how should I read the lines beyond null line in between?

[443 byte] By [ravishakyaa] at [2007-10-3 4:58:41]
# 1

There is no null line in there. There's only a line that consists of the empty string (assuming you are using readLine()).

Please not that those two variables will have different values:

String emptyString = "";

String nullString=null;

readLine() will return the value of emptyString if it reads a line that hasn't got any characters on it and the value of nullString if it reaches the end of file.

JoachimSauera at 2007-7-14 23:04:03 > top of Java-index,Java Essentials,Java Programming...