I have tried to implement your suggested code into the program, but have found it isn't workig very well. Apparently, it is unable to open the directory. This could be because I'm not entering the name in a readable form, but I'm not sure. Here's where I'm at:
#! usr/local/bin/perl
print STDOUT "Hello\!\n";
print STDOUT "This program will take a folder of Affymetrix text files
+ and put\n";
print STDOUT "their signal data in a format useful for Cyber-T\.\n";
print STDOUT "Please enter the name and location of the directory to p
+arse\:\n";
$directory=<STDIN>;
open (OUTPUTFILE,">data.csv");
opendir(DIR, "$directory") or die "Failed to open $directory: $!";
while (defined(@filename = readdir(DIR))) {
@spliced_data=splice(@filename, 0, 15);
foreach $_(@filename) {
($a, $b, $c, $d, $e, $f)=split(/\t/);
push(@final_data, "$d\n");}
print OUTPUTFILE "@final_data";
}
closedir(DIR);
Thanks for your help!!
|