#!/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\:\ *(.*)/) {$prod=$1; $prod =~ s/PERMATEX//; $prod =~ s/Permatex//; $prod =~ s/\(R\)//g; $prod =~ s/\(TM\)//g; $prod =~ s/^\ *\d[A-Z0-9]*\ *//; $prod =~ s/^\ *//; $prod="Permatex $prod"; #print "\n$prod"; } if(/Item No\.\:\ *(\d*)/) {$item=$1; #print " $item"; } # if(/Part No\.\:\ *(.*)/) # {$part=$1;print " Part $part";} } print TEMP "$prod=1=$item=2=$file=3=$prod - $item\n"; } close TEMP; system "sort -f temp > temp2"; open(TEMP,"temp2"); open(OUT,">list.html"); while() { chomp; s/(.*)=1=(.*)=2=(.*)=3=//; print OUT "$_
\n"; }