![]() |
| ||
| Uniq on certain fields I have the following file 1928282,Stephen LTD,31280938,L34 3128398,Stephen LTD,84327489,L34 I want to uniq on fields 2 & 4, the fields are comma seperated I cant figure out how to do this....any ideas? im pretty sure uniq does not support this |
| ||
| Re: Uniq on certain fields Use nawk or /usr/xpg4/bin/awk on Solaris. awk -F, '!x[$2,$4]++' input |
| ||
| Re: Uniq on certain fields You can also use the -u flag to sort, which can pick out fields: sort -t, -u -k2,2 -k4,4 Best wishes, Mike |
| All times are GMT -4. The time now is 5:00 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC