in reply to Re^3: Print line from file only once even if occurrence of pattern is more than once in the line
in thread Print line from file only once even if occurrence of pattern is more than once in the line

Thanks pme. Reason why I used two for loops is that I need to print 5 lines before and after the pattern occurrence and I did not know how I could achieve it using while loop as per your suggestion.

I tried earlier as well but in vain. Could you or anyone please help in shedding some more light on it, if you are aware?

Regards,

Jay

  • Comment on Re^4: Print line from file only once even if occurrence of pattern is more than once in the line

Replies are listed 'Best First'.
Re^5: Print line from file only once even if occurrence of pattern is more than once in the line
by pme (Monsignor) on Mar 29, 2015 at 18:40 UTC