I have two files.
Fileone contains
text string one
text string two
text string three
Filetwo contains
Name:
Address:
Summary:
Name:
Address:
Summary:
Name:
Address:
Summary:
I would like to use sed to read each line of file one and put it at the end of the summary line of file two.
Like this
Name:
Address:
Summary:Text String one
Name:
Address:
Summary:Text string two
Name:
Address:
Summary: Text String three
I have tried several things. But this got close.
while read line;
do
sed "/Summary/s/$/$line/g" filetwo
done < fileone
This puts text string one from file one onto each of the Summary lines. I would in fact like to have text string two put on the second Summary field. I though sed should read a file line by line anyway so the while may not be necessary but like I say it got me closest. I also tried placing double quotes around the "$line" this seemed to take each text string properly but gave an error due to incorrect expression. Any help would be appreciated.
Thanks..