5³â Àü¿¡ ÀÌ°÷ ½Å¼º±â ´Ô¿¡°Ô¼ awk ÀÇ °³³äÀ» ¹è¿ì°í, ±×µ¿¾È Àß ½á¿Ô½À´Ï´Ù.
±×·¯´Ù, ·Î±× ÆÄÀÏ¿¡¼ ³¯Â¥/½Ã°¢¸¸ ´Ù¸£°í ³ª¸ÓÁö´Â µ¿ÀÏÇÑ ¶óÀÎÀ» »ÌÀ»·Á°í Çß´õ´Ï.. ½±Áö°¡ ¾Ê¾Ò½À´Ï´Ù.
±×·¡¼, ±¸±Û¸µÀ» Á» Çغ¸´Ï, ¿ª½Ã³ª ½ºÅÿÀ¹öÇ÷ο쿡¼ ¿©·¯¹ø ³íÀÇ°¡ µÈ ÁÖÁ¦´õ±º¿ä. ±×Áß °¡Àå ¼Óµµ°¡ ºü¸¥ ¹æ½ÄÀÌ
http://stackoverflow.com/questions/1915636/is-there-a-way-to-uniq-by-column
¿¡¼ ¼Ò°³µÈ
awk -F"," '!_[$1]++' file
•-F sets the field separator. •$1 is the first field. •_[val] looks up val in the hash _(a regular variable). •++ increment, and return old value. •! returns logical not. •there is an implicit print at the end.
ÀÌó·³ ¼³¸íÀÌ ÀÖÀ½¿¡µµ, ¸¶Áö¸· ÁÙÀÌ ¸ô ¸»Çϴ°ÇÁö ¸ð¸£°Ú³×¿ä.
ÀÛµ¿ ÀßÇÏ´Ï±î °¡Á®´Ù ¾²±â´Â ÇßÁö¸¸, ¸ð¸£°í ¾²´Ï±î ±âºÐÀÌ ¹«Ã´ ÂòÂòÇϳ׿ä. ¤Ð
½É½ÉÇϽŠºÐ ´ñ±Û ºÎŹµå¸³´Ï´Ù ^^
|