#!/usr/bin/perl print "Borrower\tactiveDate\tAmount\n"; $Borrower = "null"; $activeDate = "null"; $Amount = "null"; $on = 0; open(FILE, $ARGV[0]); while ($line = ) { if ($on eq 0 and $line =~ /Borrower:<\/td>/) { $nextline = ; if ($nextline =~ /(.*?)(\s)/) { $Borrower = $2;} if ($nextline =~ /(.*?)<\/td>/) { $Borrower = $2;} } if ($line =~ /(\s)active(\s)date\:<\/td>/) { $nextline = ; if ($nextline =~ /(.*?)<\/td>/) { $activeDate = $2;} } if ($line =~ /Amount:<\/td>/) { $nextline = ; if ($nextline =~ /(.*?)(\s)/) { $Amount = $2;} if ($nextline =~ /(.*?)<\/td>/) { $Amount = $2;} } } if ($line =~ /<\/tr>/) { $on = 0; if ($Borrower ne "null") { print "$Borrower\t$activeDate\t$Amount\n"; $Borrower = "null"; $activeDate = "null"; $Amount = "null"; } } } close(FILE);