I have the following two files test.txt and test1.txt. I want to update the data of test.txt in to test1.txt under abc.com, however, first it has to remove the existing data so final output looks like test1.txt under output file section 
test.txt
10.100.4.10
10.100.4.11
10.100.4.12
test1.txt
[abc.com]
10.100.44.10
10.100.44.11
[xyz.com]
10.100.55.10
10.100.55.11
[etc..]
OUTPUT FILE
test1.txt
[abc.com]
10.100.4.10
10.100.4.11
10.100.4.12
[xyz.com]
10.100.55.10
10.100.55.11
 
     
    