I have 500 mb log file in server ( .txt file) . My requirement is I want only the last 1 mb data only . As all of us know it will cause a problem if I read entire file using java code and It may cause the usability issue of the application . I have no idea how to get the last one MB data and not yet started the coding . Any one can please give me suggestion ?
Thanks in Advance,
Raj
for your problem you just need to use a random access file and to place the cursor using the seek() method to the end minus 1mb …
Please read the java.io.RandomAccessFile javadoc especially the seek() comments…
HTH
Jerome