User Tools

Site Tools


awk:delete_non-consecutive_duplicate_lines

AWK - Delete non-consecutive duplicate lines

awk '!a[$0]++' contents.txt

Example

contents.txt
aaaaa
  bbbbb
ccccc
ccccc
  ddddd
ddddd
    eeeee
  bbbbb

returns:

aaaaa
  bbbbb
ccccc
  ddddd
ddddd
    eeeee
awk/delete_non-consecutive_duplicate_lines.txt · Last modified: 2021/01/06 16:23 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki