All pastes #103986 Raw Edit

Someone

public text v1 · immutable
#103986 ·published 2006-07-28 15:19 UTC
rendered paste body
use FindBin;

use lib "$FindBin::Bin/../lib";

use Xooloo::LogHelpers;
use Xooloo::ISAParser;
 

Xooloo::LogHelpers::init("$FindBin::Bin/../etc/logs.conf","audit.monoutilamoiquejedoisnommer");

notify(1,"starting");

my ($tpe, @files ) = @ARGV;

# init parser infos
my $type_inf = getParser($tpe); # or isa_csv
fatal "unknown file format '$tpe'"
     unless( defined($type_inf) );
my ($parser,$heads) = ( $type_inf->{'parser'}, $type_inf->{'fields'} );

foreach my $file ( @files ) {
     notify(2, "processing $file");
     open( my $fh, '<', $file ) 
             or fatal( "failed to open $file : $!";
     my $line_num=0;
     while( my $line = <$fh> ) {
         $line_num++;
         my $values = parseLine( $parser, $heads, $linenum, $line );
         #.... ici tu fais ta salade
     }
     close($fh);
}