#!/usr/bin/perl
use strict;
use warnings;

use Digest::MD5 qw(md5 md5_hex md5_base64);
#use MIME::Parser;
#use MIME::Entity;
#use MIME::Body;
use Getopt::Long;


use lib qw(Core);
use lib qw(Classes);
use ImagesManager;
use ResultsManager;
use ResultsTargetManager;
use ResultsUploadManager;

use Logger;

my $SCRIPTNAME = 'qa_parce_upload.pl';

my $logger = new Logger();

my $directory = "";
my @FILES_LIST = ();
my $count_files = 0;

my $TARGET = "";
my $target_list = 'conf/QA_all';
my $isparams = GetOptions(
	#"target|t=s"         => \$TARGET,
	"list|l=s"         => \$target_list	
);




open (TL, $target_list) || die "Cannot open input file $target_list: $!";
my $index = 0;
my $number = 0;
while(my $target = <TL>) {
	chomp($target);
	if ($target =~ /^#/){next;}
	if(($index % 10) eq 0) {
	$number++ }
	

	$TARGET = $target;
	if(open(FILE_OUT, ">> ". $target_list. "___" . $number. "_number")) {	
		print FILE_OUT $TARGET ."\n";

		close (FILE_OUT);
	}
	$index ++;
}

close (FILE_OUT);
exit(0);
