Search Results

Search: Posts Made By: radoulov
5,531
Posted By radoulov
Or event better (ha!): [GNU Awk] ...
Or event better (ha!):

[GNU Awk]
WHINY_USERS=1 awk 'END {
for (k in r) t[sprintf("%10d", r[k])] = k
for (k in t) print t[k]}
{ r[$0] = NR }
' filename

If GNU Awk is not available:
...
5,531
Posted By radoulov
With GNU Awk: awk 'END { for (k in r)...
With GNU Awk:

awk 'END { for (k in r) t[sprintf("%10d", r[k])] = k
n = asorti(t, _)
while (++i <= n) print t[_[i]] }
{ r[$0] = NR }' filename
5,531
Posted By radoulov
As I said, you just need to search the forums...
As I said,
you just need to search the forums to find the following solutions:


awk '!_[$0]++' input

perl -ne'print unless $_{$_}++' input

or:

perl -ne'$_{$_}++||print' input
5,531
Posted By radoulov
Is this a homework? Try searching the forums.
Is this a homework?
Try searching the forums.
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 12:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy