Counting a number of occurrences of a string between 2 strings in a text
file with UNIX
I have been working on this for a little while and have been unable to
come to a solution. Any help would be appreciated. I am working on a UNIX
workstation and have a 30-40 meg text file that I am working with. In my
real file there is hundreds of Jobs. Example of input file;
misc logging data
Job 1 start
Task start
Task stop
Task start
Task stop
Job 1 stop
Other misc logging data
Job 2 start
Task start
Task stop
Job 2 stop
Other misc logging data
Job 3 start
Task start
Task stop
Task start
Task stop
Task start
task stop
Job 3 stop
My desired output is:
Job 1, 2 Tasks
Job 2, 1 Tasks
Job 3, 3 Tasks
Thanks again...
No comments:
Post a Comment