awk -F'[][]' ' # Set ] [ as field separators.
{
A[++c] = $0 # Create indexed array: A for each record
if ( M[$1] < $2 ) # Create associative array: M for record indexed by 1st field and highest 2nd field value
M[$1] = $2
}
END { # END Block
for ( i = 1; i <= c; i++ ) # For i <= c (c is highest index of array: A
{
n = split ( A, V, "[][]" ) # Split records in array: by field separator ][ and store it in array: V
if ( M[V[1]] != V[2] ) # Print array: A element only if V[2] != M[V[1]] (M[V[1]] has highest version no. )
print A
}
}
' file