i would like to read a file and display its contents up to a certain line and the number of lines is not fixed, currently i only know how to display a fixed number of lines.
example of the text file is
>gi|514210|gb|A19638|Influenza virus type A mRNA for haemagglutinin internal fragment
CCTACTGGTCCTGTTATGTGCACTTGCAGCTGCAGATGCAGACACAATATGTATAGGCTACCATGCGAAC
>gi|6092754|gb|A79849|Sequence 6 from Patent WO9637624.
TAAAAAAACCTATAAATAATGCCCTTGTACAAATTGTTAAACGTTTTGTGGTTGGTCGCCGTTTCTAACG
Scanner s = new Scanner(new FileReader("hello.txt"));
Scanner a = s;
a.findWithinHorizon(feet,0);
if (a.hasNext())
{
for(int q = 0; q<15; q++)
System.out.println(a.nextLine());
}
example of the text file is
>gi|514210|gb|A19638|Influenza virus type A mRNA for haemagglutinin internal fragment
CCTACTGGTCCTGTTATGTGCACTTGCAGCTGCAGATGCAGACACAATATGTATAGGCTACCATGCGAAC
>gi|6092754|gb|A79849|Sequence 6 from Patent WO9637624.
TAAAAAAACCTATAAATAATGCCCTTGTACAAATTGTTAAACGTTTTGTGGTTGGTCGCCGTTTCTAACG
Scanner s = new Scanner(new FileReader("hello.txt"));
Scanner a = s;
a.findWithinHorizon(feet,0);
if (a.hasNext())
{
for(int q = 0; q<15; q++)
System.out.println(a.nextLine());
}