I am using awk -F\; 'END { for (k in arr) print k FS arr[k] }{ arr[$2] = arr[$2] ? arr[$2] FS $1 : $1 }' file name to get the output. the output which i get after runnin this command is
A ;4;5;33;45 -- '0' is missing
B ;4;5;33;45 -- '0' is missing
i think awk is not displaying 0 for the first time when it compares it with the next element in the array.
Can any one of you help me out to find the solution for this.
Thanks Vidyadhar... Its working.. Can you explain me if you have any idea what was the problem in the command that i have used. it was not displaying or comparing only 0.