Retrieve last record from text file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sharen_Su
Posted On:   Wednesday, July 10, 2002 01:21 AM


Is there anyway that you can retrieve the last record in a text file? I can retrieve all the record in the text file using readLine() but i only want the last record. Or is there any method to clear the content of the text file?

example of text file:
sit10:5;sit10:20;sit15:30;


using the readLine(), it will show


sit10:5

sit10:20

sit15:30

but i only want the sit15:30 as the output
Can anyone help me, thx.

ps: the ";" is actually a "rectangular delimiter"

Re: Retrieve last record from text file

Posted By:   arvind_br  
Posted On:   Wednesday, July 10, 2002 05:04 AM

In RandomAccessFile u can find public void seek(long pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.
About | Sitemap | Contact