awk:delete_consecutive_duplicate_lines
AWK - Delete consecutive duplicate lines
awk 'a != $0; { a = $0 }' contents.txt
Example
- contents.txt
aaaaa bbbbb ccccc ccccc ddddd ddddd eeeee bbbbb
returns:
aaaaa bbbbb ccccc ddddd ddddd eeeee bbbbb
awk/delete_consecutive_duplicate_lines.txt · Last modified: 2021/01/06 16:22 by peter