Quote:
Originally Posted by nhs
Try something along the lines of:
sed 's/insert/line 1\nline2\nline3/' <infile >outfile
|
Hi Sir,
I have a similar issue, instead of replace the string with multiple lines, I need to replace a keyword in an xml file with the contents of a txt file containing multiple lines. the xml file has a keyowrd 'kw01', and i want to replace this string with the contents of a file named fatal_alerts.txt. is this possible via sed? i badly need this. TIA!
keyword to be replaced:
kw01
fatal_alerts.txt contents:
RAISEDATTIME
--------------------
DESCRIPTION
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
18-APR-2011 06:20:32
Fatal error in Application GATE:
<Error code: 68
Caught by: CTCS_BatchSchedulerBO.HandleException
Raise by: CTCS_FTOServerBTM.ValidateMessageCount()
Message: For Interface: FTO:1315001 in File : 190107079531.txt
File Message Count Mismatch. File reported count: 447 actual message count 797.>