in reply to Re: regex/extracting whole lines
in thread regex/extracting whole lines

Thanks to all of you and apologies for not being clearer. I have a script that makes and builds the distribution for various apps and outputs results as .txt files. What I really need is to extract various results/summaries etc from the output files, strip of characters such as '*' and '-' and, as I'm using a cmd line mailer, set the results/summaries as variables. Again, sorry for not being clearer

Replies are listed 'Best First'.
Re: Re: Re: regex/extracting whole lines
by strfry() (Monk) on Oct 19, 2001 at 18:31 UTC
    hmm can you maybe paste an example of the output file (pre-regex), and if possible, show us how you want the output to appear (post-regex)?
    eg: if your file looks like so -
    ** - blah blah blah - **
    and you want it to look like this:
    blah blah blah
    then it'd be a very simple fix.

    strfry()
      Does'nt quite fit, each line starts with a double *. This is just a fraction of one of the outputs, what would be good is if I could take the 'Datasource' line and the Summary line and strip everything between. ************************************************************************ ** Datasource: EJB ** ************************************************************************ *********************************************************************** ************************************************************************ ** ** ** Exception: ** ** ** ** test.demo.oms.control.testOrganization ** ** test.demo.oms.equity.testEquitySecurityGroup ** ** test.demo.oms.lifecycle.testLifeCycleEngine ** ** test.demo.oms.lifecycle.testLifeCycleGraph ** ** test.demo.oms.ome.testOrderMatch ** ** test.demo.oms.ome.testOrderMatchingEngine ** ** test.demo.oms.trade.testOrder ** ** test.net.appl.jrisk.empiricalrisk.measure.irdelta.testIRDeltaMeasure ** test.net.appl.jrisk.equity.ejb.testEquitySecurityBeanBF ** ** test.net.appl.jrisk.interestrate.tc.index.testCaptureDefDiscreteCMSIndex ** test.net.appl.jrisk.interestrate.tc.index.testCaptureDefDiscreteMMIndex ** test.net.appl.jrisk.interestrate.tc.testCaptureDefLoanDeposit ** ** test.net.appl.jrisk.mktdata.curve.curve.testCaptureDefZeroCurve* ** test.net.appl.jrisk.mktdata.tc.testMarketDataOwnerQAS ** ** test.net.appl.jrisk.reference.testClassificationPersistence ** ** test.net.appl.jrisk.thinclient.ejb.testServletBridge ** ** ** ************************************************************************ ************************************************************************ ** ** ** Summary: 329 passed, 23 failed, 16 exceptions, 0 warning ** ** ** ************************************************************************
        maybe you should use code tags so we can see the newlines correctly then (:
        eg:
        <code>
        what you pasted here will appear like so
        </code>

        strfry()