If you can provide me a sample file maybe i can help more.
i am guessing your file and writing a sample below. ----------------------------------------------------------------------------- open(FH, "/your/file/path"); my @file = <FH>; close FH; open(FH, ">/your/new/file"); foreach my $line (@file) { if ($line =~ /(N1|N2)(.+)/ig) { if ($2 =~ /(P1|P2)(.+)/i) { print FH "Field $3 : Value $4\n"; } } } close FH; ----------------------------------------------------------------------------- Hope this helps. Ashok On 9/4/06, Nagakishor, K <[EMAIL PROTECTED]> wrote:
I have a file containing 100's of structures in it. In that file I need to identify the structures with particular name (ex: N1 AND N2) and dump the values of only some fields (ex: P1 AND P2) in to another file. If a structure does not contain the names N1 AND N2, then we should skip it. May anyone have a code for this or any idea of how to do this?