Search Results

Search: Posts Made By: manojmalhotra13
7,216
Posted By pamu
Thanks for providing above details. As per...
Thanks for providing above details.

As per your current requirement I've modified script lit bit.

Now please check.

awk 'NR==FNR{A[$1,$2]++;...
7,216
Posted By pamu
Try awk 'NR==FNR{A[$1,$2]++;...
Try

awk 'NR==FNR{A[$1,$2]++; B[$1,$2]=B[$1,$2]?B[$1,$2]<$3?$3:B[$1,$2]:$3;next}{if(A[$1,$2]>1){if(B[$1,$2]==$3){print}else{print > "another_file"}}else{print }}' file file
7,216
Posted By sathyaonnuix
PS: Look the below code as written by an awk noob...
PS: Look the below code as written by an awk noob ;)

sort -k 1,2 file | awk '{print $1,$2}' | uniq -d > temp #Identifies the reduntant values and stores it in a temp file

while read i
do...
7,216
Posted By RudiC
You did not specify what should happen a) if...
You did not specify what should happen
a) if the third column's values are identical
b) if values can go negative
c) to lines that do not have duplicates.
Thus any proposal might need further...
Showing results 1 to 4 of 4

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