5

Removing a block of duplicate lines from a file

view full story
linux-howto

http://www.unix.com – Hi all, I have a file with the data Code: 1  abc 2  123 3  ; 4  rao 5  bell 6  ; 7  call 8  abc 9  123 10 ; 11 rao 12 bell 13 ; I want remove the lines from 8 to 13 which are the repetion of the lines 1 to 6. When i use the below command, one of semicolon (;) in the first 6 lines is also getting deleted which shouldn't. Code: sort myfile | uniq But I need an ouput as Code: abc 2 123 3 ; 4 rao 5 bell 6 ; 7 call Please help me with this.. Thanks alot!! Regards, Sreenivas (HowTos)