There is a solution here that includes awk. The idea is to awk parse the desired column and remove unwanted square brackets from this token. The only “trick” is to “avoid” the symbol [so that it is not understood as a discovery. (We could also use substr, since the brackets are expected as the first and last characters)
{
if (NR < 3)
next;
sub("[[]", "", $1);
sub("]", "", $1);
print $1;
}
source
share