#!/usr/bin/perl -w my $dir = 'C:/Programs' ; use strict; use Data::Table; #Read Directory for all '.csv' file opendir(TD, $dir) || die "Can not open directory: $!:"; my @FILES=grep(/\.csv/i, readdir TD); print @FILES; closedir(TD); my $file = $FILES[0]; my $t = Data::Table::fromTSV($file,1) || die "Can not open file: $!:"; print $t->tsv foreach my $file (@FILES) { my $t = Data::Table::fromCSV($file) || die "Can not open file: $!:"; $t->addCol($file, "PCS Filename") || die "Can not add Column "; print $t->csv || die "Can not write output"; }