Take unique value to consider only second column in shell -
i have file contain below data. want take unique data consider second column.
may 23, 2013|380565195-00001 may 23, 2013|386277814-00001 may 15, 2013|370674334-00001 may 23, 2013|370674334-00001 may 23, 2013|422011458-00001 may 21, 2013|620734890-00001 may 23, 2013|721962541-00001 may 22, 2013|820591328-00001 may 23, 2013|820591328-00001 may 10, 2013|900544559-00099 may 23, 2013|900544559-00099 may 23, 2013|981242670-00001
output should below.
may 23, 2013|380565195-00001 may 23, 2013|386277814-00001 may 15, 2013|370674334-00001 may 23, 2013|422011458-00001 may 21, 2013|620734890-00001 may 23, 2013|721962541-00001 may 22, 2013|820591328-00001 may 10, 2013|900544559-00099 may 23, 2013|981242670-00001
please me on this.
awk -f"|" '{if (!h[$2]) {h[$2]=1; print;}}'
Comments
Post a Comment