I need to some strings in a file in the following fashion
Old file:
Real/Test1
Real/Test1
Real/Test2
Real/Test3
Real/Test3
Real/Test4
New File:
Real/Test1 a1 b1 c1 d1
Real/Test1 a1 b1 c1 d1
Real/Test2 a2 b2 c2 d2
Real/Test3 a3 b3 c3 d3
Real/Test3 a3 b3 c3 d3
Real/Test4 a4 b4 c4 d4
I have an intermediate file which has the old string in the column 1 and then the new string, something like this.
Test1 a1 b1 c1 d1
Test2 a2 b2 c2 d2
Test3 a3 b3 c3 d3
Test4 a4 b4 c4 d4
Could anyone please help with this?
With my very primitive knowledge, I tried following:
(while read n1 n2 do set n1 n2 sed -i "s/$n1/$n1 $n2/g" old > final done)
where "old" and "intermediate" inputs are the content mentioned above.
Thanks a lot !