I have output in this format:
/ignore-this/^/../I/want/ this@ignore-this
I am trying to use awk regex to commit the following:
../I/want/this
This would not be particularly difficult, except that I cannot figure out how to exit ^ correctly, so that it is not interpreted as a new line or not. The following is what I still have, it almost works, except that it prints:
/ignore-this/^/../I/want/this
Here is the code:
#!/bin/awk -f { if (match($0, "\^.*@")){ print substr($0, RSTART, RLENGTH-1); } }
source share