i think u should java.util.StringTokenizer Class...
it has good properties for you.
i had written a code about this.. but right now i dont know where i threw
it...:)
but firstly i stored the text of file in a StringBuffer class... then i split it
with stringtokenizer class..