#!/usr/bin/perl open(TEMP,">temp"); opendir(DIR,"files"); while($file=readdir(DIR)) { #print "\n=======\n$file"; unless($file =~ /TXT/){next;} open(IN,"files/$file"); while() { if(/Page 02 of/){last;} if(/Product Name\:\ *(.*)/) { # print; $prod=$1; $prod =~ s/Loctite//; $prod =~ s/LOCTITE//; $prod =~ s/\(R\)//; $prod =~ s/\(TM\)//; $prod =~ s/^\ *//; # $prod =~ s/(^\d{1,5}[^ ]*)\ *(.*)/$2 $1/; # $prod =~ s/(^\d{1,5}[^ ]*)\ *(.*)/$2 $1/; $prod =~ s/(^\d{1,5}[^ ]*)\ *(.*)/$2/; $prod =~ s/(^\d{1,5}[^ ]*)\ *(.*)/$2/; $prod =~ s/\ *$//; $prod="Loctite $prod"; # print "\n$prod"; } if(/Item No\.\:\ *(\d*)/) {$item=$1; #print " $item"; } # if(/Part No\.\:\ *(.*)/) # {$part=$1;print " Part $part";} } #$line="\n$prod $item<9999>$prod - $item"; #if($prodold eq $prod) {$line=" or $item";} print TEMP "$prod=1=$item=2=$file=3=$prod - $item\n"; #print TEMP "$line"; #$prodold=$prod; } close TEMP; system "sort -f temp > temp2"; open(TEMP,"temp2"); open(OUT,">list.html"); while() { chomp; s/(.*)=1=(.*)=2=(.*)=3=//; print OUT "$_
\n";; }