연속 된 중복 행을 삭제하고 싶습니다. 예 :perl이 연속 된 중복 행을 삭제합니다.
**test.txt**
car
speed is good
bike
slower than car
plane
super fast
super fast
bullet train
super fast
이렇게하면 첫 번째 발생을 제외한 모든 중복 줄이 제거됩니다.
perl -ne 'print unless $a{$_}++'
는하지만 난 OUPUT 내가이 oneliner을 시도
**test.txt**
car
speed is good
bike
slower than car
plane
super fast
bullet train
super fast
되고 싶어하지만,이 나던 아무것도 할 수 있지만, 바로 입력을 인쇄합니다.
perl -00 -F'<\w+>|</\w+>' -i.bak -lane 'foreach(@F){if ($_=~/\w+/ && ($a ne $_)){print "$_";$a=$_;}}'
수행 방법 ???
Linux를 사용 중이거나 (Windows에서 Cygwin을 사용하는 경우) [uniq (1)] (http://unixhelp.ed.ac.uk/CGI/man-cgi?uniq)를 대신 사용하십시오. –