LoginSignup
3
3

More than 5 years have passed since last update.

vim - uniq

Posted at

外部 sort、uniq コマンド

区切りを「,」として3フィールド目の値でソートし、3フィールド目の値が重複していたら削除(-u)する
:%!sort -t, -k3,3n -b -u
単純ソート
:%!sort | uniq
重複行を抜き出す
:%!sort | uniq -d
データ並びを維持しつつ、重複行を削除する
:%!cat -n
:sort /\t/
:%!uniq -2
:%s/^ *\d+\t//

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3