I want to amend each line in a Text file using sed or alternative solution
input.txt containing
line 1
line 2
line 3
...
output.txt should add two strings and
<before> line 1 and <after each line>
<before> line 2 and <after each line>
<before> line 3 and <after each line>
...
Can I use sed or something else?
Best Answer
With sed:
Explanations
s/x/y/
– substitute x by y.*
– take the whole line&
– get matched textThe rest is just the text you want to add before and after
&
.