Hi
I am beginner of shell/AWK scripting , can you please help me in select particular column and column between two pattern from a multiple column file.
file1.txt
number status date1 date2 description category type service assigned_to reported_to envioment
===== ==== === ===== ============= ============= ===== ======= ========= ======== ======
12345 open 27/06/13 28/06/13 nl21a00is-centerdb001:ncdbareq:Error in loading init Oracle Services - Trouble Tk Ticket, Auto DBA_SERVICE chadda,Deepak kumar DBA PROD
23456 open 27/06/13 28/06/13 nl21a00is-centerdb001:ncdbareq:Error in loading Sizing Oracle Services - Trouble Tk Ticket, Auto DBA_SERVICE chadda,Deepak kumar DBA TEST
45678 open 27/06/13 28/06/13 nl21a00is-centerdb001:ncdbareq:Error in loading DBMS info Oracle Services - Trouble Tk Ticket, Auto DBA_SERVICE chadda,Deepak kumar DBA QUALITY
24578 open 28/06/13 28/06/13 nl21a00is-centerdb001:ncdbareq:Error in loading Trig/Proc/Syn Oracle Services - Trouble Tk Ticket, Auto DBA_SERVICE shama,Vijay Kumar DBA PROD
45890 open 28/06/13 28/06/13 nl21a00is-centerdb001:testingQA:FSFO has configuration errors Oracle Services - Trouble Tk Ticket, Auto DBA_SERVICE Reddy,Ajay rao DBA PROD
I want to select " number, description, assigned_to "
description field end before category field start "Oracle Service-Trouble Tk"
assigned_to field is between two pattern DBA_SERVICE and DBA e.g. chadda,Deepak kumar
desire out out
out.txt
12345 nl21a00is-centerdb001:ncdbareq:Error in loading init chadda,Deepak kumar
23456 nl21a00is-centerdb001:ncdbareq:Error in loading Sizing chadda,Deepak kumar
45678 nl21a00is-centerdb001:ncdbareq:Error in loading DBMS info chadda,Deepak kumar
24578 nl21a00is-centerdb001:ncdbareq:Error in loading Trig/Proc/Syn shama,Vijay Kumar
45890 nl21a00is-centerdb001:testingQA:CSSO has configuration errors Reddy,Ajay rao
i want to select column1 and column5 (all description column before "category" column and third last column(which is in-between to pattern DBA_SERVICE and DBA)