Coloreado en 0.000 segundos, usando GeSHi 1.0.8.4
Tengo un problema de búsqueda de cadenas con expresiones regulares que no he podido resolver.
Mi problema es el siguiente:
Archivo A:
130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
Por cada línea junto las columnas en rojo para que me quede así:
52831114916620130111000008 => 831114916620130111000008
Y después buscarla en el archivo siguiente:
Archivo B:
8311149166|8311149166|||1|4|11583111491662013011100000801|2013-01-11 00:08:54|2013-01-11 00:00:08|
9171134738|9171134738|||1|8|11591711347382013011100001101|2013-01-11 00:08:54|2013-01-11 00:00:11|
3334985134|3334985134|||1|5|11533349851342013011100000401|2013-01-11 00:08:54|2013-01-11 00:00:04|
6981101359|6981101359|||1|2|11569811013592013011100000801|2013-01-11 00:08:54|2013-01-11 00:00:08|
6531342313|6531342313|||1|1|11565313423132013011100000901|2013-01-11 00:08:54|2013-01-11 00:00:09|
Resultado esperado:
SI MATCH -> 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
Lo que me sale con este código:
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
NO MATCH -> 443410446020130111000014 ** 130111000014; 0; 1294; 3; 2; 524434104460; 20986; 524434104460; 20986; 2; 0; 0
NO MATCH -> 831114916620130111000008 ** 130111000008; 0; 1298; 3; 2; 528311149166; 20986; 528311149166; 20986; 2; 0; 0
NO MATCH -> 662101154720130111000015 ** 130111000015; 0; 1298; 3; 2; 526621011547; 20986; 526621011547; 20986; 2; 0; 0
NO MATCH -> 713114789220130111000018 ** 130111000018; 0; 1294; 3; 2; 527131147892; 20987; 527131147892; 20987; 2; 0; 0
NO MATCH -> 642109609420130111000008 ** 130111000008; 0; 1294; 3; 2; 526421096094; 20986; 526421096094; 20986; 2; 0; 0
¿ Alguien me puede dar una pequeña ayuda ?
¡¡¡Saludos y Gracias!!!
Using perl Syntax Highlighting
- #!/usr/bin/perl
- use diagnostics;
- use strict;
- my %storecall = ();
- open my $IN1, '<', $ARGV[0] or die "Unable to open input file: $!\n";
- open my $IN2, '<', $ARGV[1] or die "Unable to open input file: $!\n";
- while ( my $linea = <$IN1> ) {
- my (@columna) = split( ";", $linea );
- my $_ = $columna[5] . "20" . $columna[0];
- s/\d{2}//;
- my $calldetail = $_;
- $storecall{$calldetail} = $linea;
- }
- while ( my $line2 = <$IN2> ) {
- foreach my $clave ( keys %storecall ) {
- if ( $line2 =~ /$clave/ ) {
- print "SI MATCH -> $clave ** $storecall{$clave}";
- }
- else {
- print "NO MATCH -> $clave ** $storecall{$clave}";
- }
- }
- }
- close($IN1);
- close($IN2);
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4