hello everyone. newbie here in unix. I am trying to extract the logs of a certain job and would like to output it in a readable format, see below the CAT part:
cat /var/opt/ctma/ctm/sysout/idwesct_sh30_eng_r6_cdcs_sh.LOG_05l0du_000* | egrep -i 'orderid:|file_name=' | sed "s/SH30_READ_FILE_NAME=\/var\/opt\/idwe\/data\/in//" | sed '/^LOG/ d' | sed "s/new ORDER created, orderid:0//" > /home/me/FILE
the output would be like this:
$ cat FILE
/sh30/sdt/EGDO0120110828180106
5l53d(9384457) for JOBNAME=IDWEJ77252.
/sh30/sdt/LVDO0120110828180102
5l53e(9384458) for JOBNAME=IDWEJ77332.
/sh30/sdt/RODO0120110828180111
5l53f(9384459) for JOBNAME=IDWEJ77333.
However, I want it to be in readable format such as this:
5l53d /sh30/sdt/EGDO0120110828180106
5l53e /sh30/sdt/LVDO0120110828180102
5l53f /sh30/sdt/RODO0120110828180111
So basically, I only need the first 5 characters of the 2nd, 4th, 6th, etc lines, and the whole line for the 1st, 3rd, 5th and so on...
although I was able to do this but using two files, that is all the 2nd, 4th, 6th lines is in one file, and the 1st, 3rd, 5th lines is in another file then just used the SDIFF to join them side by side... but I am thinking if there is still a more suitable way on how to do this..
your inputs are highly appreciated!