Register / Login
Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Linux / UNIX
Regarding awk start and end pattern
posted 4 years ago
In a file I am trying to find a
in this way.
The start/end patterns are repetitive in the file.
So, I want to process this pattern occurrence one by one.
line1.. line2.. # First pattern start pattern ... ... end pattern .... .... # Second pattern start pattern ... ... end pattern ... ... # Third pattern start pattern ... ... end pattern ... line n...
When I execute `awk '/start pattern/,/end pattern/' file.txt` I get
start pattern ... ... end pattern start pattern ... ... end pattern start pattern ... ... end pattern
Now, how can I process each occurrence one by one?
Thanks and Regards,
Boost this thread!
Regular expression - capture groups
error starting up 2nd instance of tomcat
Passing multiple filenames as argument
How to read each line from file in Shell script