0

I have a raw file (gx.txt) having below sample contents shown below.

TIME;PCS/Main:GxCCAInitialSuccES;PCS/Main:GxCCAInitialSuccSILP;PCS/Main:GxCCATermSuccES;PCS/Main:GxCCATermSuccSILP;PCS/Main:GxCCAUpdateSuccES;PCS/Main:GxCCAUpdateSuccSILP;PCS/Main:GxCCRTermER;PCS/Main:GxCCRTermRILP;PCS/Main:GxCCRUpdateER;PCS/Main:GxCCRUpdateRILP;PCS/Main:GxMsgsES;PCS/Main:GxMsgsSentInLP;PCS/Main:GxPdpActivatesCLP;PCS/Main:GxPdpActivatesEC;PCS/Main:GxRAAFailER;PCS/Main:GxRAAFailRILP;PCS/Main:GxRAASuccER;PCS/Main:GxRAASuccRILP;PCS/Main:GxRAATimeOutER;PCS/Main:GxRAATimeOutRILP;PCS/Main:GxRARMsgES;PCS/Main:GxRARMsgSILP;PCS/Main:GxReqRejCLP;PCS/Main:GxReqRejEC;PCS/Main:GxUsageLimitExcCLP;PCS/Main:GxUsageLimitExcEC;PCS/Main:InvGxMsgsEverRcvd;PCS/Main:InvGxMsgsRcvdInLP;PCS/Main:OvldGxMsgsEverDropped;PCS/Main:RejNoOvldGxMsgsES;PCS/Main:RejNoOvldGxMsgsSILP;PCS/Main:RejOvldGxMsgsES;PCS/Main:RejOvldGxMsgsSILP;PCS/Main:ValGxMsgsEverRcvd;PCS/Main:ValGxMsgsRcvdInLP 2019/04/10-00:00:02;4005562825;18;3989951535;40;1595046173;27;4011647600;40;1596056209;27;9607664015;86;18;4015227947;839860;0;3411465;0;72319;0;4387265;2;0;12420;0;0;105108;0;5157;8519366;0;2388;0;9614481646;85 

I have used following command to extract specific data:

$ awk -F ";" '{print $1,$35,$12,($35-$12),$15,$2,$10,$6,$8,$4,$22,$18,$22}' gx.txt TIME PCS/Main:ValGxMsgsEverRcvd PCS/Main:GxMsgsES 0 PCS/Main:GxPdpActivatesEC PCS/Main:GxCCAInitialSuccES PCS/Main:GxCCRUpdateER PCS/Main:GxCCAUpdateSuccES PCS/Main:GxCCRTermER PCS/Main:GxCCATermSuccES PCS/Main:GxRARMsgES PCS/Main:GxRAASuccER PCS/Main:GxRARMsgES 2019/04/10-00:00:02 9614481646 9607664015 6817631 4015227947 4005562825 1596056209 1595046173 4011647600 3989951535 4387265 3411465 4387265 

I wanted to assign following column headings to the output.

Date Valid_Gx_Rec Gx_sent Gx_Drop CCR_I_rec CCA_I_sent CCR_U_rec CCR_U_sent CCR_T_rec CCA_T_sent RAR_sent RAA_rec RAA_timeout 
2
  • You can print them in a BEGIN block: see When is BEGIN required in awk? Commented Apr 10, 2019 at 12:37
  • Unfortunately, I am very bad in shell scripting. therefore would be grateful if someone can help in extracting this info. Commented Apr 16, 2019 at 9:23

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.