As an example below, let's say the line I want to delete contains the string "X"
. How do I delete that line in each respective file, say, in a loop? Can I do this using grep
and sed
, or any other shell/bash program for that matter?
Line File 1 File 2
1 A A
2 B B
3 X C
4 C X
5 D D
6 E X
7 X E