Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: How to get a value from a file and save in another file

by Jasper (Chaplain)
on Apr 27, 2005 at 17:36 UTC ( #452041=note: print w/ replies, xml ) Need Help??


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.


Comment on Re^3: How to get a value from a file and save in another file
Download Code
Re^4: How to get a value from a file and save in another file
by ikegami (Pope) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://452041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-12-28 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls