Remove consecutive duplicate words from a file using awk or sed

前端 未结 6 1370
不思量自难忘°
不思量自难忘° 2021-01-16 16:53

My input file looks like below:

“true true, rohith Rohith;
cold burn, and fact and fact good good?”

Output shoud look like:



        
6条回答
  •  情话喂你
    2021-01-16 17:48

    Simple sed:

    echo "true true, rohith Rohith;
    cold burn, and fact and fact good good?" | sed -r 's/(\w+) (\1)/\1/g'
    

提交回复
热议问题