http://goo.gl/EmKxy0

Home > ASE, Developement, Start Sybase, Sybase ASE/REP Interview Questions, UNIX > How to remove duplicate rows from a file in unix

How to remove duplicate rows from a file in unix

use

cat <filename> | sort | uniq -c

 

Note: “sort” command is required before “uniq” because uniq command matches the next line with previous one. If file is not sorted then duplicate rows unlikely be filtered.

Check the Sybase Wiki @ sybasewiki.com
  1. No comments yet.
  1. No trackbacks yet.