Hello again,
You all did a wonderful job helping with my last script I had to come back and try again :)

I have been working on a script this time that will take some input from the user. (lets say the inputs name is LOT, W, tester). From this information it will then parse out a file that is already automatically created by a machine and get another bit of information from one of the lines.

What is happeneing here is that the W info they give us is also known by the name TS by the machine. to find TS the techs have to go looking through a file to find it and asked I make it easier. Once the TS is found, I can then tell the machine to look for a certain file name in a certain directory and have that file unzipped for them.

Below is the code I have so far, though I dont have it all there just the part i want to work really. the last part of it that unzipps will be easy...it is the parsing that i have a problem with.
#!/usr/local/bin/perl use warnings; use strict; my @results; print "Please enter the lot number: "; my $l = <STDIN>; print "Your lot number is $l"; print "Please enter the wafer number: "; my $w=<STDIN>; print "Your wafer number is $w"; print "Please enter the tester number: "; my $t = <STDIN>; print "Your tester number is $t"; my $sdtfile = "C:\\bzip\\sdt.log"; if (open (MAPFILE, "< $sdtfile")) { my @lines = <MAPFILE>; print "$l\n$w\n$t\n"; foreach $line (@lines) { my $cnt++; my @tokens = split(/,/, $line); my $date = lc($tokens[0]); my $time = lc($tokens[1]); my $lot = lc($tokens[2]); #print "$lot\n"; my $waf = lc($tokens[3]); #print "$waf\n"; my $ts = lc($tokens[4]); #print "$ts\n"; my $sstep = lc($tokens[5]); my $machine = lc($tokens[6]); #my $prog = lc($tokens[7]); my $product = lc($tokens[8]); my $plnfile = lc($tokens[9]); my $striping = lc($tokens[10]); if ($w ne "" ) { if (($l eq $lot) && ($w eq $waf)) { #print "Match found on machine $t\n"; #print "Timestamp is $ts\n"; #print "uncompressing any bz2 files\n"; #print "Your Datalog file is dl$ts.$t.bz2"; #push(@results, "$date,$time,$lot,$waf,$ts,$sstep,$machine +,$product,$plnfile,$striping"); #system("C:\\bzip\\bunzip2.exe C:\\bzip\\dl$ts.$t.bz2"); } } } }


here is a sample $sdtfile:
10/11/05,17:05:41,LOT1,W1,ts01,Sstep1,tester1,prog1,prod1,plan1, 10/11/05,19:24:01,LOT1,W2,ts02,Sstep2,tester1,prog2,prod2,plan2,Stripi +ng1 10/11/05,22:46:23,LOT2,W3,ts03,Sstep3,tester3,prog3,prod3,plan3, 10/12/05,01:09:40,LOT2,W4,ts04,Sstep4,tester4,prog4,prod4,plan4,


Lets say the LOT you are looking for is LOT2, the W you are looking for is W3 and the tester you are looking for is tester3.

please let me know if there is anymore informatio needed.

Sorry, I tried the readmore tags and it does nto seem to work. I hope this is not too long of a post.

In reply to parsing data from file by Sunnmann

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.