danhodges99
IS-IT--Management
Hi,
I need to place a line of text into a file at a certain point, and I have been using:
sed '
/theWord/ {
atheNewLine
}' < sourceFile > newFile
This works a treat, trouble is that it adds theNewLine underneath EVERY occurrence of lines containing theWord. Does anyone know a way to simply add theNewLine underr the FIRST occurence of theWord, or indeed how to group multiple words together as theWord and add theNewLine under that?
Hope this is clear, thanks
I need to place a line of text into a file at a certain point, and I have been using:
sed '
/theWord/ {
atheNewLine
}' < sourceFile > newFile
This works a treat, trouble is that it adds theNewLine underneath EVERY occurrence of lines containing theWord. Does anyone know a way to simply add theNewLine underr the FIRST occurence of theWord, or indeed how to group multiple words together as theWord and add theNewLine under that?
Hope this is clear, thanks