revisar_no_parseadas

#
#


use DBI;

my $dbh = DBI->connect('DBI:mysql:ri-intermedio','ri','ri') or die $DBI::errstr ;

my $busca_name = "select id,nombre from todo where nombre = ?";
my $busca_old_name = "select id,nombre from todo where oldname = ?";

my $st_name = $dbh->prepare($busca_name);
my $st_oname = $dbh->prepare($busca_old_name);

while (<>) {
        $line++;
        chomp;
        if ( /######## (.*) ########/ ) {
                $actor = $1;
                $st_name->execute($actor);
                print ("A\t$actor:");
                $ncount=0;
                while ( ($id, $nombre)  = $st_name->fetchrow_array ) {
                        $ncount++;
                        print ("\t($id $nombre)");
                }
                print ("\nB\t$actor:");
                $st_oname->execute($actor);
                $ocount=0;
                while ( ($oid, $nombre)  = $st_oname->fetchrow_array ) {
                        $ocount++;
                        print ("\t($oid $nombre)");
                }
                print ("\n");
                print "!!!NCOUNT!!!\t" if ($ncount > 1);
                print "!!!OCOUNT!!!\t" if ($ocount > 1);
                print "!!! IDS !!!" if ($ncount == $ocount and $oid != $id);
                print ("\n\n");
        } else {
                #print "$_\n";
        }
}

ResponsabilidadSocialEmpresaria/CargaDeDatosEnDrupal/ChequeadorDeLineasNoParseadas (última edición 2008-01-29 14:14:39 efectuada por localhost)