Jumping to Specific line in TXT or Binary File

Hi, I have program that takes in a 4 digit number such as "1920" then needs to open a txt file and jump to line "1920" and print out whatever the 4 digit number on that line is. I have been able to read the txt file out to the console. I have attached an example of what the txt file looks like. Thank You |74x500

cuylertech: Hi, I have program that takes in a 4 digit number such as "1920" then needs to open a txt file and jump to line "1920" and print out whatever the 4 digit number on that line is. I have been able to read the txt file out to the console. I have attached an example of what the txt file looks like. Thank You |74x500

You have two ways to get to the '1920'nd line. either read through the first 1919 lines or position the file pointer to a calculated byte offset.

do some research on the file.seek() function.

Chuck.