Hey,
I am using Perl for two weeks now and I am trying to write a little program that looks up files (*.raw) in a certain directory and then reworks the data in those files and splits them up in little txt files.
There is an error that says it couldn't get the file...
I know It is the link between the aray variable and the scalar variable but I don't seem to get it how to convert them...
It would be most helpfull if anyone could help...
Thanks
Tom
#! C:\Perl\bin\perl.exe
print "Instron data is now converted to individual files!\n";
my $dir = 'D:\Documents\Unief\DataBase\ACCESS\Perl\InputFiles';
opendir DIR, $dir or die "error: cannot open directory \"$dir\" $!";
@rawfiles = sort grep (!/^\.$|^\.\.$/, readdir(DIR));
print "@rawfiles \n";
$filelist = <@rawfiles>;
open(DATA,$filelist) or die "I couldn't get the file";
@filenames = <DATA>;
print @filenames;
close(DATA);
and so on...
I am using Perl for two weeks now and I am trying to write a little program that looks up files (*.raw) in a certain directory and then reworks the data in those files and splits them up in little txt files.
There is an error that says it couldn't get the file...
I know It is the link between the aray variable and the scalar variable but I don't seem to get it how to convert them...
It would be most helpfull if anyone could help...
Thanks
Tom
#! C:\Perl\bin\perl.exe
print "Instron data is now converted to individual files!\n";
my $dir = 'D:\Documents\Unief\DataBase\ACCESS\Perl\InputFiles';
opendir DIR, $dir or die "error: cannot open directory \"$dir\" $!";
@rawfiles = sort grep (!/^\.$|^\.\.$/, readdir(DIR));
print "@rawfiles \n";
$filelist = <@rawfiles>;
open(DATA,$filelist) or die "I couldn't get the file";
@filenames = <DATA>;
print @filenames;
close(DATA);
and so on...