Skip to main content
misc deletion option
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.

to have it deleted

sed -i -e '/PLACEHOLDER/ r TestOutput.txt' -e s/PLACEHOLDER/d/ SQLInput.txt

where

  • -e /PLACEHOLDER/d will delete entire line with PLACEHOLDER
  • -e s/PLACEHOLDER// will delete PLACEHOLDER string

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.

to have it deleted

sed -i -e '/PLACEHOLDER/ r TestOutput.txt' -e /PLACEHOLDER/d SQLInput.txt

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.

to have it deleted

sed -i -e '/PLACEHOLDER/ r TestOutput.txt' -e s/PLACEHOLDER// SQLInput.txt

where

  • -e /PLACEHOLDER/d will delete entire line with PLACEHOLDER
  • -e s/PLACEHOLDER// will delete PLACEHOLDER string
with deletion option
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.

to have it deleted

sed -i -e '/PLACEHOLDER/ r TestOutput.txt' -e /PLACEHOLDER/d SQLInput.txt

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.

to have it deleted

sed -i -e '/PLACEHOLDER/ r TestOutput.txt' -e /PLACEHOLDER/d SQLInput.txt
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

try

sed -i '/PLACEHOLDER/ r TestOutput.txt' SQLInput.txt

where

  • -i edit in place
  • /PLACEHOLDER/ search for pattern
  • r TestOutput.txt read file

note that /PLACEHOLDER/ is not deleted.