Search Results

Search: Posts Made By: sybadm
2,274
Posted By RavinderSingh13
Hello, Following may help. awk...
Hello,

Following may help.


awk 'NR==1 {print} f ~ $3 && i == 0 {i++;} f ~ $3 && i > 0 {print $0;i=0;j=1} f !~ $3 && j==1 {print $0} {f=$3;}' file_name



Output will be as follows....
2,274
Posted By Franklin52
Another approach: awk...
Another approach:
awk 'NR==FNR{a[$3]++;next}a[$3]>1{a[$3]=0; next}1' file file
2,274
Posted By pamu
awk 'NR==FNR{A[$3]++;next}{if(A[$3] > 1 &&...
awk 'NR==FNR{A[$3]++;next}{if(A[$3] > 1 && !B[$3]){B[$3]++;next} }1' file file

12 NIL ABD LON
12 NIL ABC AMR
13 NIL ABC AMR
11 NIL ABK AMR
1,451
Posted By Yoda
awk -F, ' { c[$1]++; d[$1]=$1; } { for...
awk -F, ' {
c[$1]++; d[$1]=$1;
} {
for (p in d) {
if(c[p]==1)
PI=sprintf ("%s %s", PI, d[p]);
}
}
/READ/ { RD=sprintf ("%s %s", RD, $3); }
/WRITE/ { WR=sprintf ("%s %s", WR,...
Showing results 1 to 4 of 4

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