This function is supposed to search through a text file for the new line character. When it finds the newline character, it increments the newLine
counter, and when
if newline > 2
That should be greater than or equal to if you want to get rid of the second line. Also you have newline strarting at one, then being incremented to two then reset to zero. Instead I recommend replacing the count with a boolean like
boolean firstNewlineFound = false
Then Whenever you find a newline set it to true; whenever it is true, delete onenewline and set it back to false.