#  methode-Morts-debruites-accrjourpop  nomenclatures-pays  RStandard
chdir ('data');

@l=('methode-confirmesaccrjourpop', 'methode-mortsaccrjourpop','NCas',
'RFast', 'methode-confirmes-debruites-accrjourpop','methode-Morts-debruites-accrjourpop', 'RStandard');

foreach $f (@l)
  {
  open (F,"$f");
  while (<F>)
    {
    chop;
    $nbvirg=s/,//g;
    $memovirg{$f}=$nbvirg;
    }
  print " $nbvirg et $memovirg{$f}  virgules dans $f\n";  
  close (F);      
  }


foreach $f (@l)  {
  next if $f=~/lim$/;
  print "job sur $f\n";
  if ($memovirg{$f} > 1133)
    {print "job2 sur ", $f,"\n";
    $g=$f."lim";
    open (E,"$f");
    open (G,">$g");
    while (<E>)
      {
      chop;
      @lf=split(/,/);
      foreach $u (0..1132)
        {
        print G $lf[$u],",";
        }
        print G $lf[1133],"\n"; 
      }
    close (E); close (G);
    @lf =();
    }
  else 
    {
    next;
    }  
  } 
   