user-pic

jimmy.tty

  • Commented on Day 2: When uniq is not unique enough (App::nauniq)
    I think the easiest way to keep first occurrence of each line is one of: $ awk '!a[$0]++' input.txt or $ perl -ne'$h{$_}++||print' input.txt To keep the last occurrence is enough use command tac in input.txt before awk or perl...
Subscribe to feed Recent Actions from jimmy.tty

Subscribe to feed Responses to Comments from jimmy.tty

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.