Link to home
Start Free TrialLog in
Avatar of jko n127
jko n127

asked on

insert a string below another string in a file

I have several files that conatain the string "REPORTCOUNT EVERY 60 MINUTES, RATE" I want to be able to insert another string right below the "REPORTCOUNT EVERY 60 MINUTES, RATE" string.
Avatar of arnold
arnold
Flag of United States of America image

perl -pi.bak -e 's/REPORTCOUNT EVERY 60 MINUTES, RATE/REPORTCOUNT EVERY 60 MINUTES, RATE\nAdditionalstring/;' listoffilestoenter

Test first the -i.bak will create a .bak file for everyfile where the match has occurred.
ASKER CERTIFIED SOLUTION
Avatar of jmcg
jmcg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jko n127
jko n127

ASKER

It worked very for me. Thanks