unix sort question

I have the folllowing data.  I need to sort the date time field(1) and the job number last field and write to an ouput file, but I only want to sort the time field on the lines that have the "START" word

Input file:
22:54:42:444 ZEKE JOB START: job U1KC555
22:54:42:647 ZEKE JOB START: job U1KC000
22:54:43:647 ZEKE JOB EOJ: job U1KC555
22:54:43:647 ZEKE JOB START: job U1KC111
22:54:44:647 ZEKE JOB EOJ: job U1KC000
22:54:44:649 ZEKE JOB START: job U1KC999
22:54:45:647 ZEKE JOB EOJ: job U1KC111

output:

22:54:42:444 ZEKE JOB START: job U1KC555
22:54:43:647 ZEKE JOB EOJ: job U1KC555
22:54:42:647 ZEKE JOB START: job U1KC000
22:54:44:647 ZEKE JOB EOJ: job U1KC000
22:54:43:647 ZEKE JOB START: job U1KC111
22:54:45:647 ZEKE JOB EOJ: job U1KC111
22:54:44:649 ZEKE JOB START: job U1KC999

So  I'm trying to get the start and end of the jobs listed above and below each other, but I need to sort only on the START jobs
jbrajkovichAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lanboyoCommented:
Maybe someone can roll this into an awk one liner, but it seems like a non trivial problem.

I would make a bash or tcl script, I am sure someone who is good with perl would use that. Basically read the file one line at a time and if it is an end record read the next line. If it is a start record, output that, and look below this record one line at a time until you see an end record with a matching job id. output this record. Go on to the next record in the file.


Since the data seems to only have hours and seconds, will the files be limited by day in some way?  It looks like the records are always in order of occurrence,  do you really need to sort the data by time?
Will the job IDs always be unique? Are there only start and stop records? Is there a limit to how many lines will be in the file? The last question determines whether to load the file into memory or to use a temp file.
0
jbrajkovichAuthor Commented:
I figured this problem out thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.