How to skip and read lines in txt file
Hi to all,
I want to skip and read the lines based on the JSlider movement. While change the JSlider position, it'll return a integer value. Based on the value, I want to read the particular line and continue reading.
How to skip & read the lines.
Thanks in advance.
Re: How to skip and read lines in txt file
With most files, to read the nth line, all the lines before the nth line need to be read. An exception is when all the lines are the same length. Then you can use the RandomAccessFile class to start reading at the start of the nth line by skipping over n*line-length bytes.