Shortcut to print this data???

I want the parameters to be different but instead it keep on printing the same parameter for me. This is consider as 1 parameter:
XB8B_Amodul
_R1K_R_Rmea

And also, I want for each parameter,
there are to be 5 values for each different parameter. And I am require to print for a row at least 6 parameters which are all different.
How do i achieve that?
If this is unclear to you,please take a look at my code,my incorrect output and my actual output(I provided part of it).

Thanks a lot!!!

My incorrect output:

XB8B_Amodul XB8B_Amodul XB8B_Amodul
_R1K_R_Rmea _R1K_R_Rmea _R1K_R_Rmea
...........................

1.003E+03   3.980E-08   4.994E-04

XB8B_Amodul XB8B_Amodul XB8B_Amodul
_R1K_R_Rmea _R1K_R_Rmea _R1K_R_Rmea
...........................

9.943E+02   3.994E-08   4.968E-04

XB8B_Amodul XB8B_Amodul XB8B_Amodul
_R1K_R_Rmea _R1K_R_Rmea _R1K_R_Rmea
...........................

1.000E+03   3.949E-08   4.979E-04


I want the output to be like this(I provided only 3 values n 3 parameters):

XB8B_Amodul XB8B_Amodul XB8B_Amodul
 _R1K_R_Rmea _MFA1_FETCH _MFA1_FETCH
......................................

 1.003E+03   3.980E-08   4.994E-04  
 9.943E+02   3.994E-08   4.968E-04  
 1.000E+03   3.949E-08   4.979E-04

XB8B_Amodul XB8B_Bmodul XB8B_Bmodul
 _MFA2_VT_Vt _MFB1_VT_Vt _MFB2_VT_Vt
.......................................

 2.480E+00   2.484E+00   2.484E+00  
 2.493E+00   2.487E+00   2.491E+00  
 2.487E+00   2.495E+00   2.481E+00  


My codes:


open(NEWFILE,">plusfile");
format NEWFILE =
@<<<<<<<<<<<@<<<<<<<<<<<@<<<<<<<<<<
 $testPara1[$_],    $testPara1[$_],   $testPara1[$_]
@<<<<<<<<<<<@<<<<<<<<<<<@<<<<<<<<<<
 $testPara2[$_],    $testPara2[$_],   $testPara2[$_]
...........................

@<<<<<<<<<<<@<<<<<<<<<<<@<<<<<<<<<<<<
sprintf("%.3E",$info1[$_]),   sprintf("%.3E",$info1[$_+1]),    sprintf("%.3E",$info1[$_+2])

.

open(FILE,"tablefile5");
@file1 = <FILE>;
foreach(@file1)
{
  if(/.*!.*!.*!.*!/)
  {
    ($str1,$str2,$str3,$str4) = split(/!/,$_);
    push(@stuff,$str1);
    $para1 = substr($stuff[$_],0,11);
    push(@testPara1,$para1);
    $para2 = substr($stuff[$_],12,11);
    push(@testPara2,$para2);
  }
  push (@info1,/!\+([0-9E.+\-]+)/g) if(/SYS_WAFERID!01/.../SYS_WAFERID!01/);
  push (@info2,/!\+([0-9E.+\-]+)/g) if(/SYS_WAFERID!02/.../SYS_WAFERID!02/);
 
}
for(0..$#info1)
{
write NEWFILE;
}
close(FILE);
close(NEWFILE);

kopibeanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
What is the input tablefile5 that should produce the above output in plusfile?
0
kopibeanAuthor Commented:
it is a large file.
Should i sent it to ur email address to make it more convenient for you??
0
ozoCommented:
Can't it be done with a small file (provided only 3 values n 3 parameters)?
0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

kopibeanAuthor Commented:
I provided you with 2 SYS_WAFERID(SYS_WAFERID!01 and SYS_WAFERID!02)
with 5 parameters and 5 values


Here it is:

SYS_WAFERID!01
=16x9
XB8B_Amodule_R1K_R_Rmeas!1K ohm resister!R!ohm!+1.002825E+03!+9.942619E+02!+9.999966E+02
XB8B_Amodule_MFA1_FETCHK_Idoff!MOSFET!R!A!+3.979751E-08!+3.994000E-08!+3.949102E-08
XB8B_Amodule_MFA1_FETCHK_Idon!MOSFET!R!A!+4.994273E-04!+4.967769E-04!+4.978503E-04
XB8B_Amodule_MFA1_VT_Vt!!R!V!+2.495615E+00!+2.495548E+00!+2.498353E+00
XB8B_Amodule_MFA2_FETCHK_Idoff!MOSFET!R!A!+3.960785E-08!+3.948195E-08!+3.985337E-08
=7x2
SYS_WAFERID!01
SYS_TESTSTART!09:15:39
SYS_TESTEND!09:15:52
SYS_DIECOUNT!5
SYS_WAFERPASS!1
SYS_TESTSEQ!1
SYS_SLOTNO!
=1x2
SYS_WAFERID!02
=16x9
XB8B_Amodule_R1K_R_Rmeas!1K ohm resister!R!ohm!+9.975869E+02!+9.950317E+02!+1.000017E+03
XB8B_Amodule_MFA1_FETCHK_Idoff!MOSFET!R!A!+3.951925E-08!+3.985374E-08!+3.948575E-08
XB8B_Amodule_MFA1_FETCHK_Idon!MOSFET!R!A!+4.964775E-04!+4.998018E-04!+4.956429E-04
XB8B_Amodule_MFA1_VT_Vt!!R!V!+2.488158E+00!+2.495095E+00!+2.499833E+00
XB8B_Amodule_MFA2_FETCHK_Idoff!MOSFET!R!A!+3.943191E-08!+3.963861E-08!+3.998587E-08
=7x2
SYS_WAFERID!02


Thanks a lot for your patience and help!!

0
ozoCommented:
If I run your "My codes:" above on that input, it does not produce your "My incorrect output:" above, so I'm a little confused how you'd want to modify it to produce your "I want the output to be like this(I provided only 3 values n 3 parameters):"
0
kopibeanAuthor Commented:
It is because you need to get my whole of the tablefile5 before you can get my incorrect output.Or else, you will not get my incorrect output one

You get what i mean?
Me really really need this urgently.
Please help me
If possible,i send to your email address
okie?
0
ozoCommented:
Would I also need your whole of the tablefile5 to get your correct output?
What output should the above tablefile5 with 5 parameters and 5 values produce?
0
kopibeanAuthor Commented:
Yup!!U need the whole of my tablefile5 to get my correct output.
The whole of tablefile5 will produce each row 6 parameters(max) then for each parameter,there are 5 values for it.

So u really need my tablefile5 in order to help me to get the correct output
pleaseeeee
0
ozoCommented:
is there a way to describe simply in english how the output is supposed to be produced from the input?
0
kopibeanAuthor Commented:
From the input file tablefile5,
you will get a output like this

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  



The above are just 3 parameters with 5 values for each parameter ,and the Waf is refering to the SYS_WAFERID!01 n etc.
In addition, I need to check whether my program will work regardless whether there are 25 SYS_WAFERID or less than that.And the values can be 3 or 5 or 7 or 9 values for each parameter.
Thus, you can my meaning??
Once the first row of 6 parameters is filled,it will have another row of 6 parameters with different names and etc.
You understood the whole thing??
0
ozoCommented:
# I don't see where the 1 7 9 3 5 is coming from, but this this what you want to do with the other parameters?

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+)(.*)SYS_WAFERID!\1/gs ){
    $id=$1;  $wafer=$2;
    for( $wafer =~ /(.*!.*!.*!.*!)/g ){
        ($para) = /(\w+)/;
        push @para,$para unless $col{$para};
        push @{$col{$para}[$id]}, /!\+([0-9E.+\-]+)/g;
  }
}
close(FILE);
while( @para ){
    @p3 = splice(@para,0,3);
    print NEWFILE "Waf si",(map{" ".substr($_,0,11)} @p3),"\n";
    print NEWFILE "      ",(map{" ".substr($_,11,11)} @p3),"\n";
    print NEWFILE "." x 44,"\n";
    for $id ( 0..$#{$col{$p3[0]}} ){
         for $r ( 0..$#{$col{$p3[0]}[$id]} ){
                printf NEWFILE "%3d    ",$id;
                print NEWFILE map{sprintf"%12.3E",$col{$_}->[$id]->[$r]} @p3;
                print NEWFILE "\n";
        }
        print NEWFILE "\n";
    }
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kopibeanAuthor Commented:
Can you briefly explain what the above codes will do??
Me does not really understand.
Will the above work in a version that is less than perl 5?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.