Finding line number
im creating a program in java that will read a text file then report the line number of a letter that it detects
if the line is blank it will ignore it but if the line has the letter it is looking for the program will output the line number
im not sure how to go about this
Create an int variable, call it something like "line_count", initialize it to zero.
Start a loop that will read lines from the text file. Read a line, check if the line is blank, if not blank then increment your variable, "line_count++;".
Check the characters in the line. If you find the character you are looking for then output the line number (line_count).
Shouldn't be too hard to do this.
thx i got it working
for (int i=0;i<8;i++)
for (int j=0;j<8;j++)