The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Print row if value in column 1 is the first occurence
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Print row if value in column 1 is the first occurence
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
03-17-2008
radoulov
addict
Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,892
Like a FAQ
Awk:
Code:
awk '!x[$1]++' file
Use nawk or /usr/xpg4/bin/awk on Solaris.
Perl
:
Code:
perl
-ane'print unless $x{$F[0]}++' file
radoulov
View Public Profile
Find all posts by radoulov
Find radoulov's past nominations received
Find radoulov's present nominations given