Greetings.
I'm looking to isolate the first occurrence of an arbitrary substring which may be present at any particular line in a given file. The enclosing end markers for the target in our thought problem are string"
and "
. The complete string and surrounding text could look something like this,
a bunch of lines
"blah' blah string"1.2.3.4.5.6" "sputter" "thump!"
another line
etc
...with 1.2.3.4.5.6
being our target substring.
To scrape this problem off my plate, I've tried numerous approaches; including things like
sed -i '/string\"/,/\"/!d' ./testfile
...with much hair loss and screen damage
Any tips for "happy sedding" through this wicket?
Thanks!