Guest User

Untitled

a guest
Nov 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ERROR_FILE_NOT_FOUND
  2. some text
  3. ERROR_FILE_NOT_FOUND
  4. some text
  5. ERROR_FILE_NOT_FOUND
  6. Extract line 1
  7. Extract line 2
  8. Extract line 3
  9. Stop_pattern
  10. some text
  11. ERROR_FILE_NOT_FOUND
  12. some text
  13. ERROR_FILE_NOT_FOUND
  14. some text
  15. ERROR_FILE_NOT_FOUND
  16. Extract line 5
  17. Extract line 6
  18. Extract line 7
  19. Stop_pattern
  20. some text
  21. ERROR_FILE_NOT_FOUND
  22. some text
  23. ERROR_FILE_NOT_FOUND
  24. some text
  25. ERROR_FILE_NOT_FOUND
  26. Extract line 9
  27. Extract line 10
  28. Extract line 11
  29. Stop_pattern
  30.  
  31. Extract line 1
  32. Extract line 2
  33. Extract line 3
  34. //separate if possible
  35. Extract line 5
  36. Extract line 6
  37. Extract line 7
  38. //separate if possible
  39. Extract line 9
  40. Extract line 10
  41. Extract line 11
  42. //separate if possible
  43.  
  44. $ awk '/Stop_pattern/{c=0; print ""}; c>=3;/ERROR_FILE_NOT_FOUND/{c++} ' file
  45. Extract line 1
  46. Extract line 2
  47. Extract line 3
  48.  
  49. Extract line 5
  50. Extract line 6
  51. Extract line 7
  52.  
  53. Extract line 9
  54. Extract line 10
  55. Extract line 11
Add Comment
Please, Sign In to add comment