Search Results

Search: Posts Made By: sandeep13
87,130
Posted By sandeep13
Thanks Aigles and Franklin. I already got it...
Thanks Aigles and Franklin.
I already got it work.

Regards,
Sandeep
87,130
Posted By sandeep13
Hi Guys, Once again I have a query...
Hi Guys,

Once again I have a query regarding grouping the columns, below is my requirement:

Input File:
COL1; COL2; AMT1;AMT2
PORT1;CURR1;100;50
PORT1;CURR1;200;100
PORT2;CURR2;300;150...
87,130
Posted By sandeep13
Column sum group by uniq records Reply to Thread
HI Franklin,

Thanks a lot. It works....using nawk

/usr/bin/nawk 'BEGIN{FS=OFS=";"}NR==1{print;next}{a[$1";"$2]+=$3}END{for(i in a)print i, a[i]}' file

Much appreciated.

Cheers,...
87,130
Posted By sandeep13
Column sum group by uniq records Reply to Thread
getting below o/p..missed some values in last post

PORT;PID;TOTAL
port1;p1;500
port2;p2;0
87,130
Posted By sandeep13
Hi Franklin, I tried ur solution and getting...
Hi Franklin,

I tried ur solution and getting below o/p

PORT;PID;TOTAL
port1;p1
port2;p2

I guess someting is missing, it is doing group by but missing the output values.
Thanks for the...
87,130
Posted By sandeep13
Column sum group by uniq records Reply to Thread
This one also doesn't work....
87,130
Posted By sandeep13
Hi Ranjith, Thanks for the reply but this...
Hi Ranjith,
Thanks for the reply but this doesn't work....can we use like arr[$1 ";" $2]???

Regards,
Sandeep
87,130
Posted By sandeep13
Column sum group by uniq records
Hi Jadu,

I am new to unix and i have a similar requirement given below:

Input file:

Test.txt
PORT; ID; TOTAL
port1;p1;100000
port2;p2;5000
port1;p1;500

Output file:
PORT; ID;...
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 02:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy