in reply to Re^2: How to get a value from a file and save in another file
in thread How to get a value from a file and save in another file

perl -nl -e '/^Record/../LA/ && /(LA.+)/ && print $1' datafile ?

I'm sure I'm doing much more work than necessary - but it's hot in the office.

Replies are listed 'Best First'.
Re^4: How to get a value from a file and save in another file
by ikegami (Patriarch) on Apr 27, 2005 at 20:12 UTC

    Shorter:
    perl -nle '/^\d/ .. /(LA.*)/ && print $1' datafile

    Safer:
    perl -nle '/^\d/ .. /^\d*\s+(LA.*)/ && print $1' datafile