If I have the file and there are 30 rows.How can I start reading from the 14th row?How to realize that in Java?are there any classes or methods in Java to move file pointer between rows?
I tried this on my eclipse and it worked for me.
package Codechef;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
public class readLineFromFile {
public static void main(String[] args) throws IOException {
String line = Files.readAllLines(Paths.get("E:\\text.txt")).get(7);
System.out.println(line);
}
}
output:
h
my text.txt file
a
b
c
d
e
f
g
h
i
k
this might help you
In which way does this address the question or read the specified column ?