Hi Everyone,
i have written small code where it fetches the required files from required dir path
& deleting those files before proceeding further.
script goes like this:
The above code works fine if there is only *.xls file but my problem is:
sometimes i get *.xls + filename.xls.xl s files in the dir
how to delete these *.xls.xls files with out altering the $file_name value(ie,$file_ name = "*.xls.xls" )
Can anyone help me on this ???
Regards,
Vijayal
i have written small code where it fetches the required files from required dir path
& deleting those files before proceeding further.
script goes like this:
Code:
my $@file_names;
my $full_path;
my $dir = "c:\\svap\\input\\";
my $file_name ="*.xls";
&check_file($dir,$file_name);
sub check_file($dir,$file_name){
$full_path = $dir.$file_name;
@file_names = glob($full_path);
if(@file_names eq 0){
print " no *.xls file found,can proceed further!!!";
}
else{
foreach my $i(@file_names){
unlink "$i";
}
}
}
sometimes i get *.xls + filename.xls.xl s files in the dir
how to delete these *.xls.xls files with out altering the $file_name value(ie,$file_ name = "*.xls.xls" )
Can anyone help me on this ???
Regards,
Vijayal
Comment