I want this to look at every csv file in the directory and append them all to each other in an output.txt.
open(MYOUTFILE, ">output.txt"); #open for write, overwrite
my $filecount = 0;
my @filenames;
###code that assigns all the csv file names in the present folder
#to an array and counts them
foreach $inputfilename (@filenames)
{
open INPUT, "<$inputfilename";
@lines = <INPUT>;
close INPUT;
foreach $row (@lines)
{
print MYOUTFILE ("$row\n");
}
close INPUT;
}
close MYOUTFILE;
my $ovr = <STDIN>;
exit;
As you can see my weakness is actually getting all of the csv file names into an array. I think this is going to be solved with a map command but I wasn't able to figure it out myself.