I've read How do I delete the first n lines of an ascii file using shell commands?, it is helpful. However I've a file something as below (please consider 2 columns as 2 different files):1 41 41 41 41 43 53 53 53 53 57 57 57 57 57 5I need to delete line 2-5 then 7-10 and so on (Valid outputs are 1, 3, 7 and 4, 5, 5).I know number of lines for which pattern (number) repeats. However I don't know if everytime it would follow same pattern for e.g. here its 1, 3, 7 next file can have 4, 6, 1 or 4, 5, 5 so I need to make it number of lines based than grepping the values.Can anyone give me a pointer how would I delete lines repetitively?
How to delete number of lines from file repetitively
bash;shell;shell script;sed
It sounds like you're looking for uniq.Or, from the comments:sed '2,5d;7,10d;12,$d'