Thursday, January 31, 2013

Extracting the string between two patterns in a file

Supose the file contains this phrase: That is just a test for you

I need to extract the patterns between the words is and test:


 sed -e 's/.*is//' -e 's/test.*$//' /Path-To-Your-File/yourfile.txt

and the result is:

  just a

No comments: