Hello stack overflow,
Does anyone know how to replace 'line a' with 'line b' and 'line b' with 'line a' in a text file using the sed editor? I can see how to replace a line in the pattern space with a line that is in the hold space (i.e. /^Paco/x or /^Paco/g), but what if I want to take the line starting with Paco and replace it with the line starting with Vinh, and also take the line starting with Vinh and replace it with the line starting with Paco. Let's assume for starters that there is one line with Paco and one line with Vinh, and that the line Paco occurs before the line Vinh. Then we can move to the general case.
Thanks in advance,
David