I have set of text files which have very large file size.
I dont want to read the whole file.I am only interested in block which starts with ** DATA IMP
and ends on ** DATA END
.Any data in between this block is important for me to use.
However this block may appear at start of file , at the end or in between the text file. I want this reading process to be fast.Lets say if it is at start of text file it should be as quick as linux -head which takes very lesser time for large files.
What is the optimum way to read these large files so Once I get this block, i dont have to read the file till end?
File Content Sample: (600 MB or greater)
Dummy text
Dummy text
Dummy text
Dummy text
** DATA IMP
** d
** e
** f
** g
** DATA END
Dummy text
Dummy text
Dummy text
AND SO ON ...
EDIT: *OK.I am assuming the data is at the top of file since i dont have other option.* File Content Sample: (600 MB or greater)
** DATA IMP
** d
** e
** f
** g
** DATA END
Dummy text
Dummy text
Dummy text
Dummy text
Dummy text
Dummy text
AND SO ON ...