in reply to how to check for a word in a file and if found remove that line, the above line and the below line from the file.

this is how you figure it out

so you read first line, it doesn't match

so you read second line, it doesn't match

so you read third line, it matches

so you read fourth line, it doesn't match

so you read fifth line, it doesn't match

so when should you print lines you want to print?

how many lines do you have to remember?

  • Comment on Re: how to check for a word in a file and if found remove that line, the above line and the below line from the file. (step by step)