Originally posted by Raskolnikov I need to scan through a text file checking for the first number on each line and comparing it to a number that the user has already inputted. The text file has the format . . . 1 Blah Blah Blah 2 Blah Blah Blah 3 . . ... . . . . . .. . . . . . etc I've got no problem getting the user input, it's just scanning each line, to check if the number the user entered is equal to the one at the begining of each line. Can anyone help?
Originally posted by sjones Before i go on... let me get this straight, all you want to do is get the content of the line, who's line number == user input? Or do you just want to check that a line with that number exists? (i.e 1,2,3...(n)).
foreach line in the file if line startsWith userInput return line