in reply to Get string for a word in a file after some specific pattern compare

That's pretty vague. Here's a vague response: perlre.

What do you mean by string? Do you mean everything that follows "TARGET=" and isn't a space? The general regex looks like this:

my ( $target ) = ( $string =~ /TARGET=\s*(\S+)/ );
But that's still pretty vague and might not fit what you want. Show us a few input records and exactly what data you want to extract from the records and we can better help you.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

  • Comment on (Ovid) Re: Get string for a word in a file after some specific pattern compare
  • Download Code