Reputation: 37
I got a file with the following text -
observ1
observ1
observ1
observ1
observ1
What I need is a sed command that replace it to -
observ1
observ2
observ3
observ4
observ5
Or a sed command to add observ# in the beginning of each line for example -
file 1.txt -
hi
bye
see
you
soon
After said sed command -
observ1,hi
observ2,bye
observ3,see
observ4,you
observ5,soon
Thanks!
Upvotes: 0
Views: 68
Reputation: 186
In 4 steps :
sed = a.txt | sed 'N;s/\n/,/' | sed 's/^/observ/' > b.txt
Upvotes: 1