while () { chomp; s/,/\t/g; s/\*//g; if ($_ =~ /^[A-Z]/ && $_ !~ /^TT/){ if ($_ !~ /^SERIAL/){$line = "$_"}; }; if (/Part/i) {$pn = substr($_, 32, 32)}; if (/Function/i) {$fn = substr($_, 32, 32)}; if (/Manufacturer/i) {$mn = substr($_, 32, 32)}; if (/Specification/i) {$sp = substr($_, 32, 32)}; if (/Lot/i) {$lt = substr($_, 32, 32)}; if (/AQL/i) {$aq = substr($_, 32, 32)}; if (/Accept/i) {$ac = substr($_, 32, 32)}; if (/Operator ID/i) {$op = substr($_, 32, 32)}; if (/Library/i) {$lb = substr($_, 20, 12)}; if (/Temp/i) {$tm = substr($_, 16, 6)}; if (/SERIAL NUMBER:/i) {$sn = substr($_, 14, 4)}; if (/SERIAL NUMBER:/i) {$ts = substr($_, 32, 64)}; my $col00 = substr $_, 0, 4; my $col01 = substr $_, 4, 4; my $col02 = substr $_, 10, 3; my $col03 = substr $_, 14, 7; my $col04 = substr $_, 22, 2; my $col05 = substr $_, 25, 5; my $col06 = substr $_, 31, 7; my $col07 = substr $_, 38, 2; my $col08 = substr $_, 41, 5; my $col09 = substr $_, 47, 7; my $col10 = substr $_, 55, 3; my $col11 = substr $_, 59, 7; my $col12 = substr $_, 67, 11; print "$col00,$col01,$col02,$col03,$col04,$col05,$col06,$col07,$col08,$col09,$col10,$col11,$col12,$line,$pn,$fn,$mn,$sp,$lt,$aq,$ac,$op,$lb,$tm,$ts,$sn\n" if /^[0-9]/; } close (IN);