1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#!/usr/bin/perl
use strict;
use warnings;
my $file = "FTR001A";
open(INFILE, $file) or die "Impossible d'ouvrir $file\n";
while (<INFILE>) {
chomp;
my $critere1 = substr $_, 0, 7;
my $critere2 = substr $_, 174, 20;
my $critere3 = substr $_, 194, 20;
my $critere4 = substr $_, 214, 20;
my $critere5 = substr $_, 234, 1;
my $critere6 = substr $_, 122, 6;
my $sortie = "${critere1}_${critere2}_${critere3}_${critere4}_${critere5}_${critere6}.out";
open(OUTFILE, '>>' , $sortie) or die("Impossible d'écrire dans $sortie");
print OUTFILE "$_\n";
close(OUTFILE);
}
close(INFILE); |
Partager