Thank you POJ for the suggestion and showing how to do in an effective way :). Yes, I will use your code, the way you have done it is excillent. I was trying to do in another way, though I am not feeling proud to say my code is a good one. But just tried to make it work. But without your help it was not possible. Thanks to both POJ and PRYRT, your suggestion works for me and atleast I tried to think other options. Thanks again :).

my $pin_name; my $out_pin; my $outdir_pin; my $flag_pin=0; my $csvoutpin; my $max_tran_val; open (FILE2,"<","File_2") || die "Can not open Final_output.csv File"; my @csvFile = <FILE2>; open (FILE1,"<","File_1") || die "Can not open libray File"; my @libFile = <FILE1>; for (my $i = 0; $i< @libFile; $i++) { my $line = $libFile[$i]; chomp $line; if ($line =~m/^\s*pin\s*\(\"(.*)\"\)/g || $line4 =~m/^\s*pin\((. +*)\)/g) { $pin_name = $1; chomp $pin_name; } if ($line =~m/^\s*direction\s*:\s*output/g) { $out_pin = $pin_name; $outdir_pin = $line; $flag_pin =1; } if ($flag_pin == 1) { foreach my $csvoutpinLine (@csvFile) { chomp $csvoutpinLine; my @tempLine = split(',',$csvoutpinLine); my $csvoutpin=$tempLine[0]; my $max_tran_val=$tempLine[1]; if ($csvoutpin eq $out_pin) { $line =~ s/$outdir_pin/$outdir_pin\n max_transiti +on :$max_tran_val /g ; $libFile[$i] = $line; } } $flag_pin=0; } } open (FILE3,">","File_3") || die "Can not open libray File"; print FILE3 "@libFile" ; close FILE1; close FILE2; close FILE3;

In reply to Re^4: Last value update is only happening instead of all. by anirbanphys
in thread Last value update is only happening instead of all. by anirbanphys

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.