Hello members, I have a text file and I am looking for a way to duplicate lines in it. Above every line, a duplicate line should be inserted with comment in the front as shown below. Any help will be appreciated. Can a sed or awk command do the trick. Thank you in advance.
x
y
z
--x
x
--y
y
--z
z
x
y
z
--x
x
--y
y
--z
z