Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Get string between two chars

mndcpt
2012-10-16
2013-01-06
  • mndcpt
    mndcpt
    2012-10-16

    Hello,
    at first. Thank you for this great and powerful tool!

    But i have a problem.
    I've have some ASCII files with just one line.
    I have to "extract" the text between the < > charakters into another file.

    Example:
    From: "Firstname Lastname" <testuser@testdomain.com>
    to
    testuser@testdomain.com

    or

    From: "User" <abc@domain.com>
    to
    abc@domain.com

    How can i do this?

    Thank you in advance!
    mndcpt

     
  • stahlworks
    stahlworks
    2012-10-16

    Try this:

    sfk filter input.txt -rep "_*<__" -rep "_>*__" +tofile output.txt
    
     
  • mndcpt
    mndcpt
    2012-10-16

    That's it!  So simple…and logical…
    I was totally stuck on that! :-)

    Thank you!