for ozo!Pls read : This can't seem to work?

I try out on the algorithm u give me but
it cannot produce the output I want.
(Refering to my question on -->
'How do i implement the following?')
Is there anything wrong with my program below?
I provided my codes,the output produced by my codes and the actual output.

My codes:

open(FILE,"<tablefile5") || die "Can't open tablefile5 because $!";
open(NEWFILE,">plusfile") || die "Can't open plusfile because $!";
$file = join ('',<FILE>);

while( $file =~ /SYS_WAFERID!(\d+)([^\0]*)SYS_WAFERID!\1/g )
{
    $id=$1;
    $wafer=$2;
    push(@id,$id) unless $id{$id}++;
    for( $wafer =~ /(.*!.*!.*!.*!)/g )
    {
        ($para) = /(\w+)/;
        push (@para,$para) unless $para{$para}++;
        @stuff = /!\+([0-9E.+\-]+)/g;
        for(0..$#stuff)
        {
           $col{$para,$id,$_} = $stuff[$_];
        }
        $maxlen = $#stuff if($len<$#stuff);
    }
   
}
close(FILE);

while( @para )
{
    @p6 = splice(@para,0,3);
    print NEWFILE "Waf si";
    for(@p6)
    {
      print NEWFILE " ",substr($_,0,11);
    }
    print NEWFILE "\n      ";
    for(@p6)
    {
      print NEWFILE " ",substr($_,12,11);
    }
    print NEWFILE "\n", "." x 79,"\n\n";
    %site=(
"0$;3$;1",1,
"0$;3$;2",9,
"0$;3$;3",5,

"0$;5$;1",1,
"0$;5$;2",7,
"0$;5$;3",9,
"0$;5$;4",3,
"0$;5$;5",5,

"0$;9$;1",1,
"0$;9$;2",8,
"0$;9$;3",2,
"0$;9$;4",7,
"0$;9$;5",9,
"0$;9$;6",3,
"0$;9$;7",6,
"0$;9$;8",4,
"0$;9$;9",5,

"90$;3$;1",5,
"90$;3$;2",9,
"90$;3$;3",1,

"90$;5$;1",7,
"90$;5$;2",5,
"90$;5$;3",9,
"90$;5$;4",1,
"90$;5$;5",3,

"90$;9$;1",7,
"90$;9$;2",6,
"90$;9$;3",8,
"90$;9$;4",5,
"90$;9$;5",9,
"90$;9$;6",1,
"90$;9$;7",4,
"90$;9$;8",2,
"90$;9$;9",3,

"180$;3$;1",5,
"180$;3$;2",9,
"180$;3$;3",1,

"180$;5$;1",5,
"180$;5$;2",3,
"180$;5$;3",9,
"180$;5$;4",7,
"180$;5$;5",1,

"180$;9$;1",5,
"180$;9$;2",4,
"180$;9$;3",6,
"180$;9$;4",3,
"180$;9$;5",9,
"180$;9$;6",7,
"180$;9$;7",2,
"180$;9$;8",8,
"180$;9$;9",1,

"270$;3$;1",1,
"270$;3$;2",9,
"270$;3$;3",5,

"270$;5$;1",3,
"270$;5$;2",1,
"270$;5$;3",9,
"270$;5$;4",5,
"270$;5$;5",7,

"270$;9$;1",3,
"270$;9$;2",2,
"270$;9$;3",4,
"270$;9$;4",1,
"270$;9$;5",9,
"270$;9$;6",5,
"270$;9$;7",8,
"270$;9$;8",6,
"270$;9$;9",7,
);
    for $id(@id)
    {
       for $r(0..$maxlen)
       {      
          for $r( 1..$nsite )
          {
              printf NEWFILE "%3d  %d ",$id,$site{$notch,$nsite,$r}||$r;
              for $para(@p6)
              {
              printf NEWFILE ("%12.3E",$col{$para,$id,$r});
              }
              print NEWFILE "\n";
          }
       }
       print NEWFILE "\n";
    }
    print NEWFILE "\n";
}

Output produced by my codes:

Waf si XB8B_Amodul XB8B_Amodul XB8B_Amodul
       _R1K_R_Rmea _MFA1_FETCH _MFA1_FETCH
..........................................






Waf si XB8B_Amodul XB8B_Bmodul XB8B_Bmodul
       _MFA2_VT_Vt _MFB1_VT_Vt _MFB2_VT_Vt
...........................................


Actual Output :

Waf si XB8B_Amodul XB8B_Amodul XB8B_Amodul
       _R1K_R_Rmea _MFA1_FETCH _MFA1_FETCH
...........................................

  1  1  1.003E+03   3.980E-08   4.994E-04  
  1  7  9.943E+02   3.994E-08   4.968E-04  
  1  9  1.000E+03   3.949E-08   4.979E-04  
  1  3  1.001E+03   3.949E-08   4.965E-04  
  1  5  9.952E+02   3.963E-08   4.999E-04  

  2  1  9.976E+02   3.952E-08   4.965E-04  
  2  7  9.950E+02   3.985E-08   4.998E-04  
  2  9  1.000E+03   3.949E-08   4.956E-04  
  2  3  9.977E+02   3.956E-08   4.983E-04  
  2  5  9.951E+02   3.960E-08   4.976E-04  

  3  1  9.992E+02   3.955E-08   4.976E-04  
  3  7  9.983E+02   3.991E-08   4.983E-04  
  3  9  9.983E+02   4.000E-08   4.988E-04  
  3  3  1.002E+03   3.973E-08   4.956E-04  
  3  5  9.989E+02   3.987E-08   4.993E-04  




Waf si XB8B_Amodul XB8B_Bmodul XB8B_Bmodul
       _MFA2_VT_Vt _MFB1_VT_Vt _MFB2_VT_Vt
...........................................

  1  1  2.480E+00   2.484E+00   2.484E+00  
  1  7  2.493E+00   2.487E+00   2.491E+00  
  1  9  2.487E+00   2.495E+00   2.481E+00  
  1  3  2.485E+00   2.482E+00   2.476E+00  
  1  5  2.479E+00   2.499E+00   2.482E+00  

  2  1  2.476E+00   2.496E+00   2.497E+00  
  2  7  2.487E+00   2.479E+00   2.479E+00  
  2  9  2.497E+00   2.480E+00   2.492E+00  
  2  3  2.490E+00   2.492E+00   2.499E+00  
  2  5  2.486E+00   2.483E+00   2.489E+00  

  3  1  2.477E+00   2.493E+00   2.484E+00  
  3  7  2.486E+00   2.489E+00   2.477E+00  
  3  9  2.480E+00   2.483E+00   2.491E+00  
  3  3  2.499E+00   2.484E+00   2.490E+00  
  3  5  2.493E+00   2.497E+00   2.485E+00  


kopibeanAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ozoConnect With a Mentor Commented:
$notch = $1 if( $file=~/WAFER_FLAT!(\d+)/ );
0
 
ozoCommented:

0
 
ozoCommented:
#What is $nsite ?  Did you want $nsite=5 ?  Did you want $notch=0 ?

%site=(
"0$;3$;1",1,
"0$;3$;2",9,
"0$;3$;3",5,

"0$;5$;1",1,
"0$;5$;2",7,
"0$;5$;3",9,
"0$;5$;4",3,
"0$;5$;5",5,

"0$;9$;1",1,
"0$;9$;2",8,
"0$;9$;3",2,
"0$;9$;4",7,
"0$;9$;5",9,
"0$;9$;6",3,
"0$;9$;7",6,
"0$;9$;8",4,
"0$;9$;9",5,

"90$;3$;1",5,
"90$;3$;2",9,
"90$;3$;3",1,

"90$;5$;1",7,
"90$;5$;2",5,
"90$;5$;3",9,
"90$;5$;4",1,
"90$;5$;5",3,

"90$;9$;1",7,
"90$;9$;2",6,
"90$;9$;3",8,
"90$;9$;4",5,
"90$;9$;5",9,
"90$;9$;6",1,
"90$;9$;7",4,
"90$;9$;8",2,
"90$;9$;9",3,

"180$;3$;1",5,
"180$;3$;2",9,
"180$;3$;3",1,

"180$;5$;1",5,
"180$;5$;2",3,
"180$;5$;3",9,
"180$;5$;4",7,
"180$;5$;5",1,

"180$;9$;1",5,
"180$;9$;2",4,
"180$;9$;3",6,
"180$;9$;4",3,
"180$;9$;5",9,
"180$;9$;6",7,
"180$;9$;7",2,
"180$;9$;8",8,
"180$;9$;9",1,

"270$;3$;1",1,
"270$;3$;2",9,
"270$;3$;3",5,

"270$;5$;1",3,
"270$;5$;2",1,
"270$;5$;3",9,
"270$;5$;4",5,
"270$;5$;5",7,

"270$;9$;1",3,
"270$;9$;2",2,
"270$;9$;3",4,
"270$;9$;4",1,
"270$;9$;5",9,
"270$;9$;6",5,
"270$;9$;7",8,
"270$;9$;8",6,
"270$;9$;9",7,
);
$notch=0;
open(FILE,"<tablefile5") || die "Can't open tablefile5 because $!";
open(NEWFILE,">plusfile") || die "Can't open plusfile because $!";
$file = join('',<FILE>);
while( $file =~ /SYS_WAFERID!(\d+)([^\0]*)SYS_WAFERID!\1/g ){
    $id=$1;  $wafer=$2;
    push(@id,$id) unless $id{$id}++;
    for( $wafer =~ /(.*!.*!.*!.*!.*)/g ){
        ($para) = /(\w+)/;
        push(@para,$para) unless $para{$para}++;
        @stuff = /!\+([0-9E.+\-]+)/g;
        for( 1..@stuff ){ $col{$para,$id,$_} = $stuff[$_-1] }
        $nsite = @stuff if( $nsite < @stuff );
  }
}
close(FILE);
while( @para ){
    @p3 = splice(@para,0,3);
    print NEWFILE "Waf si";
    for( @p3 ){ print NEWFILE " ",substr($_,0,11) }
    print NEWFILE "\n      ";
    for( @p3 ){ print NEWFILE " ",substr($_,11,11) }
    print NEWFILE "\n","." x 44,"\n";
    for $id ( @id ){
        for $r( 1..$nsite ){
            printf NEWFILE "%3d  %d ",$id,$site{$notch,$nsite,$r}||$r;
            for $para ( @p3 ){
                 printf NEWFILE ("%12.3E",$col{$para,$id,$r});
            }
            print NEWFILE "\n";
        }
        print NEWFILE "\n";
    }
}
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
kopibeanAuthor Commented:
$notch is
e.g.
WAFER_FLAT!0
then the notch will be
if (notch eq 0)
then it will display the values depending on how many values there are for each parameter eg,1 parameter can hav 5 values or 9 values or 3 values.
then the 'si' column will be as follows(if there are 5values for each parameter):

Waf si XB8B_Amodul XB8B_Amodul XB8B_Amodul
       _R1K_R_Rmea _MFA1_FETCH _MFA1_FETCH
............................................

  1  1  1.003E+03   3.980E-08   4.994E-04  
  1  7  9.943E+02   3.994E-08   4.968E-04  
  1  9  1.000E+03   3.949E-08   4.979E-04  
  1  3  1.001E+03   3.949E-08   4.965E-04  
  1  5  9.952E+02   3.963E-08   4.999E-04  
0
 
kopibeanAuthor Commented:
The codes above u amended, for the 'si' column,how come it produce
1
2
3
4
instead of
1
7
9
3
5

??
0
 
kopibeanAuthor Commented:
Basically you can ignore the $nsite.
All that I requires is for the 'si' column, it will first read from a statement -->WAFER_FLAT!0 from a file
if the value of WAFER_FLAT! is 0 then it will print:
(This is for 3 values for each parameter)
1
9
5
(This is for 5 values for each statement)
1
7
9
3
5
and etc.

if the value of WAFER_FLAT! is 90 then it will print:
This is for 3 values for each parameter)
5
9
1
(This is for 5 values for each statement)
7
5
9
1
3
and etc.
The rest of the values of WAFER_FLAT!
will be 180 and 270,then they will also do the same thing as 0 and 90.
Earlier on,i provided all the values for each 0,90,180,270 respectively.
Please read one more time?Thanks for ur precious time!!!

0
 
kopibeanAuthor Commented:
Your line of code,i try out.
But it does not seem to work>?
the 'si' column still prints 4 values only
1
2
3
4
instead of 5 values
1
7
9
3
5
0
 
ozoCommented:
Did you change
 $wafer =~ /(.*!.*!.*!.*!)/g
to
 $wafer =~ /(.*!.*!.*!.*!.*)/g
?
0
 
kopibeanAuthor Commented:
Your line of code,i try out.
But it does not seem to work>?
the 'si' column still prints 4 values only
1
2
3
4
instead of 5 values
1
7
9
3
5
0
 
kopibeanAuthor Commented:
Can you explain on why you have written the algorithm for the 'si' column in this way???
0
 
ozoCommented:
I wanted to duplicate the list of values you supplied in your earlier question,
but remembered that you were using Perl4, not Perl5, so I used $; instead of nested data structures
0
All Courses

From novice to tech pro — start learning today.