I want to replace part of a file's data, with data from another file.
Suppose file1
has data as is written below and file2
has some data I want to store and replace file1
data from file2
from starting pattern: // +++ CUSTOMIZATION SETTINGS START +++
and the end pattern: // +++ CUSTOMIZATION SETTINGS END +++
.
In file1
:
ANJALI
NISHA
// +++ CUSTOMIZATION SETTINGS START +++
WE WILL BE ON LEAVE FOR TODAY
// +++ CUSTOMIZATION SETTINGS END +++
PREETI
MONA
In file2
:
MANISH
MADHVI
// +++ CUSTOMIZATION SETTINGS START +++
WELCOME ALL
// +++ CUSTOMIZATION SETTINGS END +++
NISHA
TUSHAR
In file3
as output:
ANJALI
NISHA
// +++ CUSTOMIZATION SETTINGS START +++
WELCOME ALL
// +++ CUSTOMIZATION SETTINGS END +++
PREETI
MONA