Hi,
Input is same...
Now that this output is generated need to just delete the occurances..
Considering same output
But output is:
Code:
BCCH 4 0 4 6 9 106 1351 77
BCCH 4 0 4 6 9 106 1352 68
NON_BCCH 4 0 4 6 9 106 1351 87
NON_BCCH 4 0 4 6 9 106 1351 113
NON_BCCH 4 0 4 6 9 106 1352 112
NON_BCCH 4 0 4 6 9 106 1351 122
NON_BCCH 4 0 4 6 9 106 1352 119
NON_BCCH 4 0 4 6 9 106 1352 124
NON_BCCH 4 0 4 6 9 106 1352 756
If you just check 3rd 4th 6th only last values are varrying.... So what i want is in same line it should be appended
Like
Non_BCCH 4 0 4 6 9 106 1351
87 113 122
thats it... Considering the last values in same line...
What i tried was:
By using below input
contents of file.txt:
TCS,1
TCS,2
TCS,3
TCS,4
CTS,1
CTS,2
CTS,3
O/P:
TCS, 1 2 3 4
CTS, 1 2 3
But i am not sure that al values wil be in continuous manner
considering
abc,1
abc,2
xyz,5
abc,4
i am not getting
Below code
awk -F, '
{
if(NR == 1)
printf("%s",$0);
else
{
if($1 != var)
{
printf("\n%s,%d",$1,$2);
}
else
printf(" %s",$2);
}
var = $1;
}' file.txt