I am creating a Java application in which I need to read the first few lines of a huge text file and do the processing.
Is it possible that instead of getting the entire file, I read the first few lines and fetch the data? And this is being done using Java API.
I am creating a Java application in which I need to read the first
Share
Yes, it can be done. When you use BufferedReader, for example, you read just (buffer_size) from the file. Then you can process it before reading the next fragment…
for example, see this tutorial