Quote: my $samplefolder = $ARGV[0]; opendir (DIR,"$samplefolder") || die ("Can't open the input folder for reading"); my (@files) = grep/\.xml$/,readdir(DIR); closedir(DIR); my $mergestr; for my $file (@files){ #$mergestr .= $file."\n"; open (IN,"$samplefolder\\$file") || die ("Can't open the input file for reading"); undef $/; my $str = <in>; close (IN); $mergestr .= "<merge_$file>\n".$str."\n\n\n"; } open (OUT,">$samplefolder\.xml")||die ("Can't open the output file for writing"); print OUT $mergestr; close (OUT); open(DIR, ">>samplefolder")|| die "$!"; #OPEN FILE FOR WRITING @samplefolder=@field; printf $samplefolder;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)