I would like to delete every line that contains a pattern after the first line (the pattern is
/^country\t/). I can delete every occurrence with
sed '/^country\t/d' in.txt > out.txt, but I would like to keep the first occurrence on the first line.
The back story is that I have a directory of tab-delimited files with headers and I concatenate these files with
cat. I would like to remove the extra headers.
In Vim I could do something like
: 2,$g/^country\t/d, but I can't figure out the sed solution. When I try
sed '2,$ /^country\t/d in.txt > out.txt I get the error
unknown command: /.