-4

I am stuck with this activity ,I have a txt file like below

0112 00000 34 JOB RECOVERY status poll (ORDERID 2N000, RUNNO 0001) ACCEPTED, OWNER
0112 00000 35 JOB RECOVERY status poll (ORDERID 2N000, RUNNO 0001)STARTED , APPL TYPE
0112 00000 36 JOB PROCESS Kafka(ORDERID 2N001, RUNNO 0001) ACCEPTED , OWNER
0112 00001 37 JOB PROCESS Kafka (ORDERID 2N001, RUNNO 0001) STARTED, APPL_TYPE
0112 00001 38 JOB RECOVERY  status poll(ORDERID 2N000, RUNNO 0001) ENDED OK ,ELAPSED - 0.02 SEC
0112 00003 39 JOB PROCESS (ORDERID 2N001, RUNNO 0001) ENDED OK, ELAPSED - 2.28 SEC

I need to get elapsed - value for each orderid for each job , I need like if orderid is 2N000, then the elapsed I should get-0.02 sec. like this for each orderid I need to get from the file using shell script.

I need the output like

orderid    jobname           ELAPSED
2N000      RECOVERY status   0.02
2NOO1      PROCESS  Kafka   2.28
Kusalananda
  • 333,661
  • 2
    What have you tried so far and where are you stuck? Is the text really this haphazardly formatted, with random spaces inserted around commas and other spaces seemingly missing in front of parentheses? – Kusalananda Jan 14 '22 at 06:19
  • yes, I have tried to get the orderid ,jobname and elapsed time using awk command ...awk '/elapsed/' {print $5,$14,$7). but the problem is the job , we cant take always the same coulmn number like 5 , since the jobname is having space in between also – user510083 Jan 14 '22 at 06:25
  • Why only two lines of results for six lines of data? If you're coalescing please explain how. If you're filtering please explain why
  • – Chris Davies Jan 14 '22 at 07:44
  • 1
  • Why double space in PROCESS Kafka output when there is a single space in every similar source line?
  • – Chris Davies Jan 14 '22 at 07:45
  • You say that for order id 2N000 you want an elapsed time of -0.02, but you don't show that in the example output
  • – Chris Davies Jan 14 '22 at 07:47